aspose file tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes MDB's & transaction attributes Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Reply Bookmark "MDB Watch "MDB New topic
Author

MDB's & transaction attributes

manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
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
Nikhil Pendharkar
Ranch Hand

Joined: Sep 01, 2003
Posts: 44
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 agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: MDB's & transaction attributes
 
Similar Threads
Transactions questions
Understand MDB Transaction
Tx attribute for MDB
Message-driven beans and transaction attributes
BMT and Bean Type.