File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Question about MDB and their Transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Reply Bookmark "Question about MDB and their Transaction" Watch "Question about MDB and their Transaction" New topic
Author

Question about MDB and their Transaction

Daniel Breitner
Ranch Hand

Joined: Nov 13, 2008
Posts: 70
Hello everybody,

just a quick question because I was confused by Ethnuwares Training program:

Is it possible for a MDB for actually rollback a transaction from a bean sending a message to the MDB ?

I thought that MDBs would live in a transaction context that would always be created for them by the container ...


Visit me at http://liferay-blogging.blogspot.com
Ivan Krizsan
Bartender

Joined: Oct 04, 2006
Posts: 2193
Hi!
I have understood it as follows (please correct me if I am wrong!):
When a MDB is involved in a transaction which includes receiving a message, rolling back the transaction will result in the message being re-inserted into (or not removed from, in the first place) the queue. Inserting the message into the queue is done in another, earlier, transaction.
Remember that messages to MDBs do not go directly from the sender to the MDB, but always via a queue.
References:
EJB 3.1 Specification, chapter 13 (with sample scenarios in section 13.2).
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Question about MDB and their Transaction
 
Similar Threads
Why allow Required MDB xtion attribute
mock exam + MDB transaction
Welcome to our author of the week
Question on Transactions
MDBs and transactions