Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris


Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets say bean method foo1Required() is running under transaction tx1. Lets say inside foo1Required() it invokes another method foo2RequiresNew().

The method names also indicate the tx attribute declared in the dd.
Inside foo2RequiresNew() the transaction is a new transaction and it cannot see the transaction in foo1Required().

Which means the changes made to bean fields inside the foo1Required() method before the foo2RequiresNew() method should not be visible to foo2RequiresNew() method.
But to make life easy I guess it should be visible.
If foo2RequiresNew() method completes then the method foo1Required() takes over with bean fields changed by foo2RequiresNew()
But if now there is a rollback how does rollback effect this?

Changes to the bean fields inside foo2RequiresNew() should be committed but those inside foo1Required() before and after the method call foo2RequiresNew() should not be commitede but rolled back.
==>How can that be?

==>Or is it that when a bean method invokes another bean method there is a special case and foo2RequiresNew would not start a new transaction?
    Bookmark Topic Watch Topic
  • New Topic