• 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
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

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 showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic