Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

MDB's & transaction attributes

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • 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)
Rgrds
Manish
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • 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".
 
I've never won anything before. Not even a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic