Hi,
I believe the explanation is confusing (or misunderstood by me).
As far as I understand, discarding instances only happens if their method throws an exception (that is not an application exception).
In this case 'The bean A instance will be discarded' will only be true if mA() throws the javax.ejb.EJBTransactionRequiredException. If there would be a catch inside the mA() for that exception and the exception would not be propagated further, bean A instance will not be discarded. So 'gettting' an exception is not enough for an instance to be discarded.
Similar situation is at question 381, where I believe the answer 'The A instance will NOT be discarded' should be true. If the bean A will not throw the exception, it will not be discarded (or the explanation should be changed, because receiving an exception is not enough for discarding the instance). In this question 'encounters' should be replaced with 'throws' in assignment.
(Sorry for not putting the 381 question to its own topic, but I wanted to have it on one place as I think they are related)
About Question enthuware.oce-jpad.v6.2.394 :
Moderators: Site Manager, fjwalraven
-
- Site Admin
- Posts: 10061
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.394 :
You are right. The option has now modified to make it clear that Bean A instance will be discard only if there is no exception handling code for the call to mB(). The explanation has also been modified accordingly.
thank you for your feedback!
thank you for your feedback!
If you like our products and services, please help us by posting your review here.
Re: About Question enthuware.oce-jpad.v6.2.394 :
javax.transaction.TransactionRequiredException is thrown only to remote clients. For local clients, javax.ejb.EJBTransactionRequiredException is thrown.
But on the javaDoc:
http://docs.oracle.com/javaee/6/api/jav ... ption.html
It is specified that
I think TransactionRequiredLocalException is for local:This exception is thrown to a remote client to indicate that a request carried a null transaction context, but the target object requires an active transaction.
http://docs.oracle.com/javaee/6/api/jav ... ption.html
EJBTransactionRequiredException for container managed remote
and
javax.transaction.TransactionRequiredException for rmi remote
Thanks
-
- Posts: 60
- Joined: Wed Apr 23, 2014 6:38 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.394 :
Not really the heart of the question, but can you comment on Tony_Lang's post above. The javaDoc he quotes and links seems to contradict that "avax.ejb.EJBTransactionRequiredException" will be thrown, since the API says the exception is thrown to remote clients and blue answer #1 says it is thrown to local clients.
-
- Site Admin
- Posts: 10061
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.394 :
He is right. Fixed.
thank you for your feedback!
Paul.
thank you for your feedback!
Paul.
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 73 guests