About Question enthuware.oce-ejbd.v6.2.592 :
Moderator: admin
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.592 :
Hi,
Table 15 of EJB 3.1 specification clearly says that in case of any system exception, the container must throw EJBException to client. So I think the implementation is not compliant. It does show root cause (i.e. the cause by section) as EJBTransactionRequiredException, as I suspected.
May be since EJBTransactionRequiredException extends EJBException, it can be argued that it is complaint. But the wordings of the specification are very clear. It says, "Throw EJBException".
HTH,
Paul.
Table 15 of EJB 3.1 specification clearly says that in case of any system exception, the container must throw EJBException to client. So I think the implementation is not compliant. It does show root cause (i.e. the cause by section) as EJBTransactionRequiredException, as I suspected.
May be since EJBTransactionRequiredException extends EJBException, it can be argued that it is complaint. But the wordings of the specification are very clear. It says, "Throw EJBException".
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 38
- Joined: Fri Aug 16, 2013 11:37 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.592 :
If client of Bean A would also have been a statless session bean, its instance would also have been discarded?
-
- Posts: 38
- Joined: Fri Aug 16, 2013 11:37 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.592 :
Bean instance is discarded when system exception is thrown from bean.
Here bean A could have caught system exception from bean B and handled properly, I agree if bean A would have thrown system exception from bean B as it is to the container, than bean A instance will also get discarded, but it is no where mentioned that bean A didn't handle any system exception it got from bean B. So how bean A instance got discarded?
Here bean A could have caught system exception from bean B and handled properly, I agree if bean A would have thrown system exception from bean B as it is to the container, than bean A instance will also get discarded, but it is no where mentioned that bean A didn't handle any system exception it got from bean B. So how bean A instance got discarded?
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.592 :
You are right, it doesn't say whether A handles the exception or not. That is why "Bean A will be discarded is not in the options" either. The explanation is just talking about a hypothetical situation where the exception is not caught because normally such system exception are not meant to be caught.
HTH,
Paul.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 38
- Joined: Fri Aug 16, 2013 11:37 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.592 :
Thanks Paul, if catching system exception would also have discarded instance, I would have been in big trouble, thanks.
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.592 :
Does this translation happen in Bean A's method? Bean A's method receives javax.ejb.EJBTransactionRolledbackException, wraps it to EJBException and throws it further down to the call chain?A system exception in a bean's method translates to an EJBException.
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.592 :
No, the translation is done by the container. Bean A's method will simply propagate whatever exception it receives up to the container (if it is not caught by the bean A's method). The container will then decide what exception should actually be thrown to the client.
If you like our products and services, please help us by posting your review here.
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.592 :
I see, thank you very much for all your explanations. Passed today with 91%.
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.592 :
Congratulations!! Good score!
What did you miss?
What did you miss?
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 34 guests