This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
According to HFEJB page 460 it is only for BMT ...
"If you DO use BMT, you have two choices for how the container sends an acknowledgement to the messaging service. The choices are: <acknowledge-mode>Auto-acknowledge</acknowledge-mode> or <acknowledge-mode>Dups-ok-acknowledge</acknowledge-mode> "
Originally posted by Lionel Orellana: According to HFEJB page 460 it is only for BMT ...
Can anyone explain why you can't use it for CMT?
I think the answer should be found in how JMS works. In JMS when you use distributed transactions (i.e. CMT) you cannot set the delivery mode, the message is acknowledged when the transaction commits successfully. That�s why you shouldn�t set acknowledge mode when using CMT.
When you use BMT the message is acknowledged when you return normally from the onMessage method, i.e. that you do not throw a RuntimeException from inside the onMessage method. The difference between Auto-acknowledge and Dups-ok-acknowledge is that with Auto-acknowledge the bean provider is guaranteed that the message is only delivered once-and-only-once with Dups-ok-acknowledge you do not have that guarantee, and the bean provider should write could that can handle that the same message is delivered more than once. Dups-ok-acknowledge is supposed to be more performance efficient than Auto-acknowledge. [ July 13, 2004: Message edited by: Christian D. Th. Sellberg ]
Good observation about the CMT Acknowledge mode..As per the EJB specs 2.0, section 15.4.8.this is what it says about the ack-mode
"Message-driven beans should not attempt to use the JMS API for message acknowledgment. Message acknowledgment is automatically handled by the container. If the message-driven bean uses container managed transaction demarcation, message acknowledgment is handled automatically as a part of the transaction commit."
In English it means that let the container take care of the Acknowledge-mode as far as CMT is concerned.
Cheers!! Gaurav B
[SCJP 2][SCWCD1.4][SCBCD1.3]<br />First Deserve Than Desire!!