if you "manually" commit a transaction, you might get:
javax.ejb.EJBTransactionRolledbackException: Illegal to call this method from injected, managed EntityManager
in this case you should annotate the method:
@TransactionManagement(TransactionManagementType.BEAN)
to make the transaction management "manual".
You can't have both worlds: either you let the container manage the "begin/end/rollback" lifecycle, or you manage it in its entirety.
No comments:
Post a Comment
comments where you are promoting your business will be marked as SPAM :o)