Thank you!AnotherBean must be a CMT bean.
- Site Admin
- Posts: 8913
- Joined: Fri Sep 10, 2010 9:26 pm
Please let me know if you need more clarification.As per Section 13.6.1 - 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.
In this case, since the question specifies that anotherBean.anotherMethod() executes in the same transaction that is started by myMethod(), anotherBean has to be a CMT bean, otherwise, the transaction started in myMethod() would be suspended.
- Posts: 16
- Joined: Tue Nov 08, 2016 9:39 pm
Does it mean the following?
MySessionBean.myMethod (Tx1 - BMT) ---> AnotherBean.anotherMethod (Tx1 - CMT)
So "AnotherBean.anotherMethod" because of being CMT cannot set the transaction for rollback using UserTransaction.setRollbackOnly() right?
Thanks in advanve
- Posts: 4
- Joined: Fri Dec 04, 2015 2:26 pm
"As per Section 13.6.1 - 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. "
As a suggestion for completeness purposes, I would put as is in EJB 3.1 spec Section 13.6.1, one sentence before this one:
In this way, the explanation will be clearly stated that it is describing about BMT and not CMT.The container must manage client invocations to an enterprise bean instance with bean-managed trans-
action demarcation as follows.
Just a suggestion.
Users browsing this forum: No registered users and 2 guests