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

Moderator: admin

Post Reply
himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post by himaiMinh »

So, bean B is not discarded because of these reasons:
1. when bean B is not supposed to run in any transaction context, the container throws the exception.
2. the exception is thrown by the container in step 1, not by bean B.

Bean B is not discarded.

Correct me if I am wrong.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post by himaiMinh »

Regarding to this question, if the client bean has a try/catch block to handle the EJBException thrown from bean A, where the EJBException is caused by the container and the NEVER attribute of bean B,

will the client bean discarded ?

I assume if the client bean can handle any EJBException thrown from other callee bean, the client bean's transaction won't be marked for rollback and won't be discarded.

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

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

Post by admin »

Yes, it is the bean that throws a system exception out to the container that is discarded, not the bean that receives such an exception (if it handles the exception). Same with the transaction.
If you like our products and services, please help us by posting your review here.

aazizi.tarik
Posts: 31
Joined: Sun Dec 27, 2015 1:47 pm
Contact:

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

Post by aazizi.tarik »

Could you please say what is the exception thrown from mB()?
Like for example in case of mandatory it throws javax.ejb.TransactionRequiredException?

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

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

Post by admin »

mB() will not throw any exception because it will not even be invoked. The container will throw an EJBException to the caller.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests