wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes message acknoledgement in MDBs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "message acknoledgement in MDBs" Watch "message acknoledgement in MDBs" New topic

message acknoledgement in MDBs

vasu maj
Ranch Hand

Joined: Jul 12, 2001
Posts: 395
Is there a way to make sure that an acknwoledgement is sent when a transaction is rolled back in case of a container managed transaction?

What a wonderful world!
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
Section 15.4.8 of the EJB 2.0 specification states that "If the message-driven bean uses container managed transaction demarcation, message acknowledgment is handled automatically as a part of the transaction commit."
Further, in section, it says "If the onMessage method does not successfully complete or the transaction is rolled back by the Container, JMS message redelivery semantics apply."
The JMS message redelivery semantics ensures that if a failure occurs while executing the onMessage() method, the message is automatically redelivered.
The bottom line is that when you use CMT, the container is responsible for acknowledging the message. If the transaction fails, the container should redeliver the message until is goes through. Certain vendor-specific optimizations and strategies may apply, though.

[Blog] [Blogroll] [My Reviews] My Linked In
Consider Paul's rocket mass heater.
subject: message acknoledgement in MDBs
Similar Threads
WA #1.....word association
Delete Query problem: Failure to Commit HQL Delete Transaction
Cannot insert values into a table
Nested Transaction Model
Transaction Problem