aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Question about exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Question about exception" Watch "Question about exception" New topic
Author

Question about exception

Li Xin
Ranch Hand

Joined: Feb 06, 2004
Posts: 37
Here is a question about EJB exception:
Which one of the following statements regarding the client view of exceptions received from an enterprise bean invocation is correct?
1. The client can safely continue the transaction by retrying the operation if an application exception is received.
2. The client can safely continue the transaction by retrying the operation if an application exception is received, but only after checking the transaction has not been marked for rollback.
3. The client can safely continue the transaction by retrying the operation if a non-application exception is received.
4. A local client cannot continue a transaction if javax.transaction.TransactionRolledbackLocalException is received.
5. A remote client cannot continue a transaction if javax.transaction.TransactionRolledbackException is received.
The provided answer is 5 only, but I think 2 and 4 are also correct, any idea about this?
Thanks.
Sunil Patil
Greenhorn

Joined: Feb 05, 2003
Posts: 15
I agree with you.
Sunil
Janne Karhu
Ranch Hand

Joined: Oct 29, 2003
Posts: 33
- Question 2 is confusing; what does the "safely" really mean in this case? I would bet that 2 is correct anyway (if the client is EJB, use getRollbackOnly() and if not, use UserTransaction.getStatus()).
- Question 4 is correct in my opinion. How is it supposed to differ from question 5?

Originally posted by Li Xin:
Here is a question about EJB exception:
Which one of the following statements regarding the client view of exceptions received from an enterprise bean invocation is correct?
1. The client can safely continue the transaction by retrying the operation if an application exception is received.
2. The client can safely continue the transaction by retrying the operation if an application exception is received, but only after checking the transaction has not been marked for rollback.
3. The client can safely continue the transaction by retrying the operation if a non-application exception is received.
4. A local client cannot continue a transaction if javax.transaction.TransactionRolledbackLocalException is received.
5. A remote client cannot continue a transaction if javax.transaction.TransactionRolledbackException is received.
The provided answer is 5 only, but I think 2 and 4 are also correct, any idea about this?
Thanks.
Jack Zhou
Ranch Hand

Joined: Dec 27, 2003
Posts: 93
4 in incorrect because local client receivs javax.ejb.TransactinRolledBackExcepiton not the one in javax.transaction pacage.
1) is wrong becuase you don't know if the transaction is rolled back
2) is wrong becuase if don't have a way to know if it is rolled back if it is containers started the transaction and the bean make decision in this code.


Thanks,<br />Jack Zhou<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS,SCEA
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about exception