File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Nested Transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Nested Transaction" Watch "Nested Transaction" New topic

Nested Transaction

prem karun gopal

Joined: Dec 03, 2003
Posts: 24
Dear All,
I know that EJB doesnt support nested transactions.
But am confused about this scenario.
Session Bean A exists.
A has following methods A.foo1(),A.foo2().A.foo3()
Transaction attributes for these methods are
foo1() {
So in this case foo1 and thereby foo2 's transaction gets suspended when it calls foo3 ,after foo3 the suspended one resumes again.
Does this scenario comes under Nested Transaction Or seems like Nested Transaction.Pls comment on this.
Also friends pls give me some info about NestedTransactions.I am a bit confused abt this Transaction Model.

Prem Kumar.k<br />Email
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
That's not a nested transaction. The outer transaction scope is suspended while the inner transaction executes. If the outer transaction fails after the inner transaction has completed, then things remain as they are after the completion of the inner transaction.
A "Nested transaction" would mean that if the outer transaction fails the the inner transaction would roll back as well.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
Ravi Ramachandra

Joined: Dec 01, 2003
Posts: 6
Hi Kyle,
Is the RequiresNew equivalent to the concept of Aitonomous Transaction concept in Oracle 9i?
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
I have no idea, I'm not familiar with that concept in Oracle 9i.
I agree. Here's the link:
subject: Nested Transaction
It's not a secret anymore!