• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Transactions: Mix BMT & CMT

 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic