• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TransactionRolledBack Exception

 
Yan Zhou
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have seen individual posts regarding this subject, I just want to make sure that I can summarize the correct behavior as follows, and ask one more question:

for both BMT and CMT beans, if there is a system exception in the middle of a transaction, the container logs the exception, rolls back the transaction and discard the bean instance. Again, this is for BOTH BMT and CMT beans.

now, when does the above system exception cause the container to throw TransactionRolledBackException or TransactionRolledBackLocalException to client? Does this have anything to do with transaction attributes in DD? Does ONLY CMT beans throw this exception?

Thanks.
Yan
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container should throw one of these exceptions after discarding the bean instance if the instance had run in a client transaction. One can therefore deduce that the bean method must have had a transaction attribute of Required, Mandatory or Supports.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yan 1327,

Please change your displayed name to conform to JavaRanch's Naming Policy.

In your case please use a first name (or initial) followed by a family name.

You may change your displayed name here.

Thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic