Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Trsxn commit/rollback query.  RSS feed

 
Stephen Selvaraj
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I 'm bit confused....
If a bean throws a Application Exception will the Transaction be committed before throwing the Application Exception to the client.

Any comments...
- Stephen
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's say that this is a CMT bean. Transactions are scoped at method level for all CMT beans. When an application exception is thrown, the container is required by the EJB spec not to rollback the transaction. There are two ways to end a transaction: commit or rollback. So, the container must commit the transaction at the end of the method.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!