Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

transactions - mixing BMT with CMT

 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy!

What happens when I mix BMT with CMT? Let's say:

m1() -> m2()

* method m1 has BMT and calles userTransaction.begin() before calling m2()
* method m2 has CMT - REQUIRED.

Is the transaction propagated?
 
Mahendr Shinde
Ranch Hand
Posts: 38
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If m2() is being invoked from m1() which has Transaction running, there are chances that your code will work. But why are you mixing CMT and BMT, you can use CMT for all your business methods. That way you don't have to lookup for Transaction in JNDI and hard code everything!
I assume both this methods belongs to different EJB's.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic