Page 1 of 1

About Question enthuware.oce-ejbd.v6.2.610 :

Posted: Fri Jan 15, 2016 2:25 am
by costin1989
Hi, could you explain a little bit more this answer:
AnotherBean must be a CMT bean.
Thank you!

Re: About Question enthuware.oce-ejbd.v6.2.610 :

Posted: Fri Jan 15, 2016 9:15 am
by admin
Not sure if you saw the explanation given with this option, so I am quoting it here:
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.
Please let me know if you need more clarification.

HTH,
Paul.

Re: About Question enthuware.oce-ejbd.v6.2.610 :

Posted: Tue Dec 27, 2016 10:22 pm
by Gerardo
Hi Paul,

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

Re: About Question enthuware.oce-ejbd.v6.2.610 :

Posted: Wed Dec 28, 2016 8:03 am
by admin
That is correct.

Re: About Question enthuware.oce-ejbd.v6.2.610 :

Posted: Wed Dec 28, 2016 8:06 am
by Gerardo
Thanks Paul :)

Re: About Question enthuware.oce-ejbd.v6.2.610 :

Posted: Sun Jun 25, 2017 8:51 am
by adriano.jesus
About the explanation of the option 5:

"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:
The container must manage client invocations to an enterprise bean instance with bean-managed trans-
action demarcation as follows.
In this way, the explanation will be clearly stated that it is describing about BMT and not CMT.

Just a suggestion.
Best regards.