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

Moderator: admin

Post Reply
costin1989
Posts: 15
Joined: Tue Apr 21, 2015 1:36 am
Contact:

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

Post by costin1989 »

Hi, could you explain a little bit more this answer:
AnotherBean must be a CMT bean.
Thank you!

Online
admin
Site Admin
Posts: 8943
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

Gerardo
Posts: 16
Joined: Tue Nov 08, 2016 9:39 pm
Contact:

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

Post 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

Online
admin
Site Admin
Posts: 8943
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

That is correct.
If you like our products and services, please help us by posting your review here.

Gerardo
Posts: 16
Joined: Tue Nov 08, 2016 9:39 pm
Contact:

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

Post by Gerardo »

Thanks Paul :)

adriano.jesus
Posts: 4
Joined: Fri Dec 04, 2015 2:26 pm
Contact:

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

Post 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests