Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transaction rollback in ejb2.0

 
Sagar Kale
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic