Win a copy of Rust Web Development this week in the Other Languages 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Regarding Nested transaction in EJB

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I came across a statement that there are no nested transactions as of EJB2.0. Please have a glance at the example stated below

e.g.
Consider two CMT Beans A & B.
Bean-A contains a method foo() with a transaction attribute "Required".
Bean-B contains a method boo() with a transaction attribute "RequiresNew".

Now when a method "foo()" in a transaction calls method "boo()", the incoming transaction from "foo()" is suspended temporarily and the method "boo()" starts a new transaction.

My Question:Is not the above is an example of nested transactions (or) my interpretation itself is wrong.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well yes your interpretation is completely wrong here.

Here in this case transactions T2 (Transaction started by the method boo()) is not running inside transaction T1 (Transaction for foo()). So there's no nested transaction.

Transaction T1 is suspended while transaction T2 is running. Once T2 completes , T1 resumed.

I hope this will clear some of your confusion.

Regards,

Rajesh
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If transaction T2 fails, T1 may still commit fine and vice-versa.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic