About Question enthuware.oce-jpad.v6.2.394 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
heaven

About Question enthuware.oce-jpad.v6.2.394 :

Post by heaven »

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)

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

Re: About Question enthuware.oce-jpad.v6.2.394 :

Post by admin »

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!
If you like our products and services, please help us by posting your review here.

Tony_Lang

Re: About Question enthuware.oce-jpad.v6.2.394 :

Post by Tony_Lang »

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
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.
I think TransactionRequiredLocalException is for local:
http://docs.oracle.com/javaee/6/api/jav ... ption.html

EJBTransactionRequiredException for container managed remote

and

javax.transaction.TransactionRequiredException for rmi remote

Thanks

bluster
Posts: 60
Joined: Wed Apr 23, 2014 6:38 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.394 :

Post by bluster »

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.

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

Re: About Question enthuware.oce-jpad.v6.2.394 :

Post by admin »

He is right. Fixed.

thank you for your feedback!
Paul.
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 73 guests