My IT-blog about my experiences with: Java / JEE, IT Conferences and IT Certifications
17.6.2.10 Handling of getUserTransaction Method
If an instance of an enterprise bean with container-managed transaction demarcation attempts to invoke
the getUserTransaction method of the EJBContext interface, the container must throw the
java.lang.IllegalStateException.
Jonh Smith wrote:If I understood your point #1 would actualy be the correct answer.
The spec says about this:
17.6.2.10 Handling of getUserTransaction Method
If an instance of an enterprise bean with container-managed transaction demarcation attempts to invoke
the getUserTransaction method of the EJBContext interface, the container must throw the
java.lang.IllegalStateException.
1. With bean-managed transaction demarcation, the enterprise bean code demarcates transactions using the javax.transaction.UserTransaction interface.
2. With container-managed transaction demarcation, the container demarcates transactions per instructions provided by the developer in metadata annotations or in the deployment descriptor. These instructions, called transaction attributes, tell the container whether it should include the work performed by an enterprise bean method in a client’s transaction, run the enterprise bean method in a new transaction started by the container, or run the method with “no transaction” (Refer to Subsection 13.6.5 for the description of the “no transaction” case).
The transaction attribute applies only to CMT. It has no bearing on BMT. As per EJB 3.0 final spec:
My IT-blog about my experiences with: Java / JEE, IT Conferences and IT Certifications
Consider Paul's rocket mass heater. |