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 CMT and Business method exceptions - question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "CMT and Business method exceptions - question" Watch "CMT and Business method exceptions - question" New topic
Author

CMT and Business method exceptions - question

Saeed Amer
Ranch Hand

Joined: Jan 20, 2004
Posts: 140
Hi everyone,

How will the EJB container handle exceptions thrown by a business method of a bean with container managed transaction demarcation?

For example, if the instance did not call setRollbackOnly(), would the container COMMIT the transaction or ROLLBACK the transaction and Why?

My opinion is that the transaction should be rolledback but I may be wrong.

I understand that if the instance called setRollbackOnly(), the container will rollback the transaction.

TIA,

Saeed
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10090
    
164

If any Runtime exception occurs, then the container will rollback the transaction. See section 8.7.4. Unchecked Exceptions at:

[ UD: removed link to copyrighted material ]
[ August 03, 2007: Message edited by: Ulf Dittmer ]

[My Blog] [JavaRanch Journal]
Saeed Amer
Ranch Hand

Joined: Jan 20, 2004
Posts: 140
Thank you so much Jaikiran!

The link you have provided is very useful.
Do you have link to the latest version of these books? These books are like 6 to 8 years old.

Thanks again!

Saeed
[ February 21, 2006: Message edited by: Saeed Amer ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CMT and Business method exceptions - question