• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Quick question on transactions

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the container always roll-back the transaction (or at least mark the transaction for roll-back)? Even whith BMT beans?
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Does the container always roll-back the transaction (or at least mark the transaction for roll-back)? Even whith BMT beans?


What do you mean by "always"? Transactions will only rollback when there are unexpected events happened. For BMT, the container will not help you to rollback the transactions, you need to explicit declare that the transaction is rollback by ut.rollback(), where ut is an object of UserTransaction.

Nick
 
Grand Puba
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry Nick,
I wasn't very clear in my question (I think that's the stress because I have the exam today). I actually ment: Does the container always roll-back the transaction (or at least mark the transaction for roll-back) when a System exception is thrown ?

Sorry for my previous question...
Thx 4 the reply thou
 
Everybody's invited. Except this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic