Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CMT and Business method exceptions - question

 
Saeed Amer
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Saeed Amer
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic