aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Enthuware Explanation Doubt-23 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Enthuware Explanation Doubt-23" Watch "Enthuware Explanation Doubt-23" New topic
Author

Enthuware Explanation Doubt-23

Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
As per section 5.4.17 of EJB 3.0 Core specification, a message-driven bean’s message listener method must not throw the java.rmi.RemoteException. It can throw any other exception. If it throws an application exception, the transaction (if any) is rolled back, the exception is rethrown to the resource adapter, and the bean is NOT discarded. If it throws a system exception, the exception is logged, the transaction (if any) is rolledback, and the bean is discarded.


The bold line says, for application exception thrown, if there is transaction it will be rolled back. I don't find any such line in the specifications.

The spec.'s simply says-

The message listener methods of some messaging types may throw application exceptions. An application
exception is propagated by the container to the resource adapter.


Did they added this line on their own even mentioning it is from specif. or they the spec. got updated?
the transaction (if any) is rolled back,


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 402
Tx will be rolled back if only App exception has been marked for roll back.
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
Yes it is true, but they didn't mentioned in their line.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Enthuware Explanation Doubt-23
 
Similar Threads
Some doubts about exception handling
Application Exception in MDB
Query about MDB throwing application exception
MDB throw system exception
MDB Message Redelivery and discard