Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What happend CMT inside BMT ?? (see)

 
Dilip Gamage
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what I understood... if there any errors please correct me

My problem is...

CMT (start)
|
|BMT (start)
|
|BMT (end)
|
|
CMT (end)



Let say CMT inside BMT(as above). According to theory once BMT execute it will suspend CMT temporarly. Then let say BMT will rollback due to some reason
What happend to CMT ??

what i understood from book is BMT will roll back, and CMT will never roll back. Is that applicable for reality ??
please just explain me if any one knows

 
Grand Puba
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also think the BMT will roll back, and CMT will not roll back but in reality , the BMT method will probably throw an application exception to indicate this behaviour...

Greetz
 
Sandesh Tathare
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dilip,

When transaction started by BMT is rollback, transaction started by CMT will not be rollbacked and it will continue once BMT method call is completed.
 
Yi Zou
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't this nested transaction that aren't supported by current EJB?
 
Arun Krishnamoorthy
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No... a nested transaction would imply that there's a dependency between the CMT and BMT transaction but, there is no such relationship.

The BMT and CMT execute under separate,unrelated transactions.
 
Dilip Gamage
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arun Krishnamoorthy says
The BMT and CMT execute under separate,unrelated transactions


Seperate ??
do you mean CMT suspended when executing BMT and behave seperately. But CMT nested transaction require to complete the BMT to commit the CMT as mention above ^

I didn't get the answer ? yet. Thanks you all attempt my problem
 
Arun Krishnamoorthy
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the CMT transaction suspends before the BMT transaction is started.
Transactions can never propagate into a BMT bean. BMT beans always execute under their own transactions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic