• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transactions: Mix BMT & CMT

 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We use a vendor framework that has only a single "gateway" session bean, mostly for remote access purposes. It is actually deployed twice, once as CMT and once as BMT. The gateway dispatches calls to "services" which have to be written to run under CMT or BMT or both. CMT is a very natural fit for most of our services, but we have one that requires BMT and calls existing CMT services via the gateway bean.

Finally the question: Can our call stack go: BMT -> CMT -> BMT ? I don't have handy the details on the symptoms that make us think this is causing trouble. Sorry about that.
 
Edy Yu
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BMT -> CMT -> BMT

First, it's not possible to propagate your TX context from CMT -> BMT as BMT always starts a new TX. This means that you have to suspend your CMT TX before entering BMT ... (nested TX is not supported ...) So, be careful of the possible behavior.

Second, from BMT -> CMT, if you want to propagate your BMT TX to CMT, you can't set ur CMT TX attr requireNew ...

Overall, this mixed design poses some potential difficulties and should be avoided ...

My 2 cents.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This attempt appears to be confusing a 3rd party package we use, so we're making it BMT end to end by moving some code from the CMT to a POJO that can be called either way. Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic