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.
About Question enthuware.oce-ejbd.v6.2.495 :
Moderator: admin
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.495 :
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.
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.
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.495 :
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.
-
- Posts: 31
- Joined: Sun Dec 27, 2015 1:47 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.495 :
Could you please say what is the exception thrown from mB()?
Like for example in case of mandatory it throws javax.ejb.TransactionRequiredException?
Like for example in case of mandatory it throws javax.ejb.TransactionRequiredException?
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.495 :
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.
Who is online
Users browsing this forum: No registered users and 35 guests