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

BMP transaction propagation v nested transaction

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a bit cloudy about some aspects of transaction propagation. EJB does not support nested transactions so that

public void go() {

UserTransaction ut = context.getUserTransaction();
ut.begin();
doStuff();
ut.begin;

...... etc

is an illegal nested transaction.


But what if you have 2 objects each has a method with a transaction demarcation and one object's method calls the objects other method. Is this an illegal nested transaction or an example of transaction propagation. As far as I understand a BMT bean can propagate into another transaction or can it?. Can anyone clear this up for me.

Thanks.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>>> "But what if you have 2 objects each has a method with a transaction demarcation and one object's method calls the objects other method. Is this an illegal nested transaction or an example of transaction propagation."

No, this will not result in a nested transaction (Assuming both are BMT objects). When the first BMT object calls the second BMT object, the first transaction will get temporarily suspended. And the second object will operate in a new transaction of its own.

>>> "As far as I understand a BMT bean can propagate into another transaction or can it?. Can anyone clear this up for me."

Both CMT and BMT can propagate to another CMT object. But no transaction can propagate into a BMT object. If a BMT object gets called from within a transaction context, it will temporarily suspend the calling transaction and will start a new transaction.
 
"To do good, you actually have to do something." -- Yvon Chouinard
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic