• 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

MDB - Bean Managed Transaction

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have an application where MDB's are introduced to implement asynchronous processing. The MDB in-turn is used to call other existing classes which handle the backend interactions. These classes use JDBC transactions - have commit, rollback statements.

This forces me to use Bean Managed Transactions for the MDB. Is there any disadvantage of using BMT over CMT - if so, what needs to be done to address it? Is there any alternative ?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using BMT will force you to take care of the transaction commits/rollbacks etc... (as you can see in the JDBC code that you are mentioning). Other than that i dont see any drawback of using BMT.

Just a question, is there any logic involved in the MDB other than invoking the classes which do JDBC work? If there's no logic involved in the MDB other than this, i dont see a need to have a transaction on this MDB since all the transaction handling will be done by the classes doing JDBC.
 
Sub swamy
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The MDB basically delegates task to a set of of handler classes. One among this set of handler does JDBC transaction. Otherwise there is no transaction in MDB.
 
Tongue wrestling. It's not what you think. And here, take this tiny ad. You'll need it.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic