bean-managed-transactions

How to propagate a client-side UserTransaction into a stateless session bean using BMT

£可爱£侵袭症+ 提交于 2019-12-20 05:17:05
问题 This scenario using CMT is working: Stateless session bean with CMT, one method annotated with @TransactionAttribute(TransactionAttributeType.MANDATORY) . Within this method, a record is written into a RDBMS using an XA data source and plain JDBC. The stand-alone client (separate JVM, command-line Java application) is getting a UserTransaction from the application server (by JNDI lookup), starts the transaction, and calls the EJB. If the client commits the UserTransaction , the record is

Why do EJB beans with bean-managed transactions act as a “transaction barrier”?

左心房为你撑大大i 提交于 2019-12-19 07:49:58
问题 A quote from the EJB 3.1 specification: 13.6.1 Bean-Managed Transaction Demarcation The container must manage client invocations to an enterprise bean instance with bean-managed transaction demarcation as follows. When a client invokes a business method via one of the enterprise bean’s client views, the container suspends any transaction that may be associated with the client request. On the other hand, a transaction from a stand-alone client or another EJB is propagated into a bean using

How does UserTransaction propagate?

本小妞迷上赌 提交于 2019-12-17 18:07:11
问题 I have a stateless bean with bean-managed transactions, and a method like this: @Stateless @TransactionManagement(TransactionManagementType.BEAN) public class ... { @Resource private UserTransaction ut; @EJB private OtherStatelessBeanLocal other; public void invokeSomeMethods() ut.begin(); ... // invoke other bean's methods here. other.method(); ... ut.commit(); } } So how does the UserTransaction propagate to the OtherStatelessBeanLocal bean? 回答1: The UserTransaction object is an object

Glassfish: JTA/JPA transaction not rolling back

╄→гoц情女王★ 提交于 2019-12-11 07:54:53
问题 I am running Glassfish 3.1.1 with an Oracle database and have run into an issue with transactions not rolling back, but only on one specific environment so far. The same application works as expected on other machines. However, two separate Glassfish domains on the same machine are impacted. Within the affected environment, I have similar results with both a container-managed transactions (CMT) inside an EJB that throws a RuntimeException, and a bean-managed transaction (BMT) with

How to propagate a client-side UserTransaction into a stateless session bean using BMT

半世苍凉 提交于 2019-12-02 05:26:32
This scenario using CMT is working: Stateless session bean with CMT, one method annotated with @TransactionAttribute(TransactionAttributeType.MANDATORY) . Within this method, a record is written into a RDBMS using an XA data source and plain JDBC. The stand-alone client (separate JVM, command-line Java application) is getting a UserTransaction from the application server (by JNDI lookup), starts the transaction, and calls the EJB. If the client commits the UserTransaction , the record is written into the database. If the client rollbacks the UserTransaction , the record is not written into the

Why do EJB beans with bean-managed transactions act as a “transaction barrier”?

◇◆丶佛笑我妖孽 提交于 2019-12-01 04:47:46
A quote from the EJB 3.1 specification : 13.6.1 Bean-Managed Transaction Demarcation The container must manage client invocations to an enterprise bean instance with bean-managed transaction demarcation as follows. When a client invokes a business method via one of the enterprise bean’s client views, the container suspends any transaction that may be associated with the client request. On the other hand, a transaction from a stand-alone client or another EJB is propagated into a bean using container-managed transactions . Looking at it from the CMT perspective, it seems that beans using CMT

How does UserTransaction propagate?

左心房为你撑大大i 提交于 2019-11-28 06:29:44
I have a stateless bean with bean-managed transactions, and a method like this: @Stateless @TransactionManagement(TransactionManagementType.BEAN) public class ... { @Resource private UserTransaction ut; @EJB private OtherStatelessBeanLocal other; public void invokeSomeMethods() ut.begin(); ... // invoke other bean's methods here. other.method(); ... ut.commit(); } } So how does the UserTransaction propagate to the OtherStatelessBeanLocal bean? The UserTransaction object is an object supplied by the container which wraps access to API calls that the container uses internally, specifically javax