Hi,
The correct answer is:
The bean A instance will be discarded if there is no exception handling code for call to mB().
The explanation is next:
Because the call to mB will throw a javax.ejb.TransactionRequiredLocalException, which extends from EJBException and thus is a system exception. If there is no exception handling for this call, the exception will propagate out of the Bean A instance, which will cause the Bean A instance to be discarded.
As I know if a bean receives RuntimeException(without @application exception) the transaction would be always rolled back (if active) and the bean itself should be discarded.
First time hear that such exceptions could be handled and bean would not be discarded.
Please check.
About Question enthuware.oce-jpad.v6.2.394 :
Moderator: admin
-
- Posts: 42
- Joined: Tue Feb 12, 2013 4:35 pm
- Contact:
-
- Site Admin
- Posts: 10103
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.394 :
The explanation is correct. A system exception causes a bean to be discarded when it is not handled i.e. thrown out of the bean to the container. A bean may contain code that causes a runtime exception to be thrown. If the bean doesn't handle it and lets it propagate out to the container, it will be discarded. Otherwise not.
If you like our products and services, please help us by posting your review here.
-
- Posts: 42
- Joined: Tue Feb 12, 2013 4:35 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.394 :
Hi,
Thank you very much for the clear explanation.
Thank you very much for the clear explanation.
-
- Posts: 31
- Joined: Wed Mar 16, 2016 8:38 am
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.394 :
Hi all,
I didn't understand why is the answer A wrong...doesn't mA indeed get a javax.transaction.TransactionRequiredException?
Thank you
Regards
Fabio
I didn't understand why is the answer A wrong...doesn't mA indeed get a javax.transaction.TransactionRequiredException?
Thank you
Regards
Fabio
-
- Site Admin
- Posts: 10103
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.394 :
No, as the explanation says, it will get javax.ejb.EJBTransactionRequiredException.
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 1 guest