About Question com.enthuware.ets.scbcd.v5.2.198 : Test 3 question 39

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
Alex

About Question com.enthuware.ets.scbcd.v5.2.198 : Test 3 question 39

Post by Alex »

Hi,
I think some points needs more precisions in this question. Or at least the explanation.
The question says anything about the interface of the session bean. So we can assume that the bean is exposed through a EJB 2.1 client view interface (does the exam be so vicious ? ;) ).
In this case the exception thrown by the container is effectively javax.transaction.TransactionRolledbackException. But in this case, the exception thrown for a local client is not the one you name in explanations. The exception thrown for a local client invoking through an ejb 2.1 view is : javax.ejb.TransactionRolledbackLocalException.
the exception you mention in this question : javax.ejb.EJBTransactionRolledbackException, is thrown in the use case you describe but for a classic EJB 3.0 business interface exposed as local or remote.
So, if the goal of the question is exception handling whithout knowing the type of interface (the bean could be exposed as an EJB 2.1), the proposed answers are corrects but, i think explanations shoud be more precise.
Moreover, a bean could be exposed through a 2.1 client view and through a 3.0 view.

But if you had in mind an EJB 3.0 business interface, I think there is a problem in this question. No valid proposal.

I hope i was enough clear.
Regards,
Alex

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

Re: About Question com.enthuware.ets.scbcd.v5.2.198 : Test 3 question 39

Post by admin »

You are right. I think the confusion is arising because the term "remote client" is not very clear. Option 1 and 2 have been updated to:
1. The client may have called the method through the bean's remote or local interface..
2. The client must must have called the method through the bean's local interface.

Now, option 1 is correct because of the following reason:


When a bean running in the client's transaction context encounters a system exception, the container marks the transaction for rollback and throws a javax.ejb.EJBTransactionRolledbackException to all 3.0 clients whether local or remote (for a 2.1 local client, javax.ejb.TransactionRolledbackLocalException is thrown). However, if the business interface is a remote business interface that extends java.rmi.Remote, the javax.transaction.TransactionRolledbackException is thrown to the clients. Therefore, in this case, since javax.ejb.EJBTransactionRolledbackException is thrown to the client, all we can say is that the client is a 3.0 client and it may have invoked the local or remote interface of the bean.

thank you for your feedback!
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 31 guests