@Stateful @TransactionManagement (BEAN) public class SomeBeanClass implements SomeBeanInterface { @Resource javax.Transaction.UserTransaction transaction; public void myMethodOne () { transaction.begin (); ... } public void myMethodTwo () { ... transaction.commit (); } } @Stateless public class SomeBeanClass implements SomeBeanInterface { @TransactionAttribute (REQUIRED) public void myMethod () { ... } }
bean demarcated transactions
transaction must not be active or exception is thrown
transaction must be active or exception is thrown
no specific demarcation performed by the container
active transaction suspended during call
active transaction used or new transaction started during call
active transaction suspended and new transaction started during call