Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

message acknoledgement in MDBs

Ranch Hand
Posts: 398
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
Author & Gold Digger
Posts: 7617
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
Garden Master Course kickstarter
    Bookmark Topic Watch Topic
  • New Topic