• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transaction question

 
Tontang Bei
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is it that they(study notes and exam pointers in book) always say that "A BMT bean must never start a tx before completing the previous one." I thought nested transactions werent allowed in EJB (CMT or BMT), so why do they specifically have to say "BMT"??
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats because you define the transaction boundary in BMT. With CMT you define the methods that should have a transaction and you define what type of transaction it is. So an overlap of transactions here is not possible. When you call other methods they must define what kind of transaction they want (in CMT).

With BMT you use the start() commit() and rollback() methods to define the boundary and thus using start() twice would amount to a nested transaction.
 
Deepak Kanwar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you answered your own question. Nested transaction are not allowed. In case Of BMT - you started it - you finish it.
In CMT container will take care
 
Tontang Bei
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ohhhhhhhh..thanks to you both.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic