• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

MDB's & transaction attributes

Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All
I was going through Message Driven Beans(MDB) . I read that we can only have 2 transaction attribute types on the onMessage method of the MDB.
they are required & notsupported.
Could someone ellaborate on why only these 2 and not the other transaction attrib's
What i read is Because transaction context never flows over JMS messages, a
message-driven bean can never perform work in the scope of the client's transaction.
The transaction attributes of the onMessage method are hence restricted to Required
and NotSupported.

Now in this scenario what if the calling client has a transaction context & the onMessage method has a required transaction attribute
Could someone ellaborate a bit why requiredNew/mandatory will not work for onMessage keeping in mind both the contexts (calling method has a transactioncontext & the other phenomena is the calling method does not have a transaction context)
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For Message driven Beans we can only define transaction scope for onMessage() method .
If the message receipt of a message-driven bean is to be part of the
transaction, then the MDB must use the
"Required" transactional attribute otherwise it should use "NotSupported" because MDB can either be required to be a part or transaction not so for this type of situation above attributes are used .
Also MDB is not going to propogate the transaction further so it won't need "RequiresNew" or "Mandatory".
    Bookmark Topic Watch Topic
  • New Topic