• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

CMT and Business method exceptions - question

 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Enjoy the full beauty of the english language. Embedded in this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic