• 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

foo2RequiresNew

 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic