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

What does the UserTransaction.rollback() do??!!

Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am studying Transaction management in EJB. I have read through almost all the stuff life : CMT, BMT , ACID, JTS, JTA, blabla... And after several hours of practice, I am still confusing.

Well, first of all, it is very difficult to find a real demonstration of UserTransaction.rollback(). Even from Sun, they just gave us some pseudo code like :

I try the code myself and it was useless because after rollback, things are not rolled back, for both local and instance variable which are modified after ut.begin().

Secondly, considering this case:

I see this case as nested transaction and I know that container doesn't support it. But my question is: Can the rollback statement rollback the Customer data as if it has never been affected?

Similarly, I don't know what other methods like commit, setRollbackOnly really do to the object instances, variables ..ect..

That's all about my concern. By the way, if anyone know good sample of transaction managment with EJB (the real working code, not bothersome theory ), please tell me.

Space pants. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic