File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Transaction rollback in ejb2.0 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 » Java » EJB and other Java EE Technologies
Bookmark "Transaction rollback in ejb2.0" Watch "Transaction rollback in ejb2.0" New topic
Author

Transaction rollback in ejb2.0

Sagar Kale
Ranch Hand

Joined: May 02, 2008
Posts: 188
Hi All,

The ejb2.0 specification says if SystemException is thrown in business method, transaction will be rolled back.

What if ApplicationException is thrown?

The transaction is not rolled back?
[ August 31, 2008: Message edited by: Sagar Kale ]
Bupjae Lee
Ranch Hand

Joined: May 14, 2007
Posts: 107
If business method throws application exception, then the container does not rollback "automatically".

If you think transaction should be rollback, you still can rollback it manually by EJBContext.setRollbackOnly() [CMT bean] or UserTransaction.rollback() [BMT bean]
Sagar Kale
Ranch Hand

Joined: May 02, 2008
Posts: 188
Thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transaction rollback in ejb2.0
 
Similar Threads
JMS
Doubt on EJBExceptiion and EJB Transaction Rolledback Exception
Exceptions
Can the client continue after getting the exception ??? and other doubts
BMT stateful SB and incomplete trans: behaviour question