Sending Messages to a Message-Driven Bean

   

Acknowledging Messages from Message-Driven Beans

You should not use the client message acknowledgment methods defined in the JMS API to acknowledge messages to the client. Because there is no direct connection between the client and the message-driven bean, the container handles the message acknowledgment automatically. That way, the container handles it depending on whether you are using container-managed transaction demarcation or bean-managed demarcation .

If you are using container-managed transactions, the container will acknowledge the message as part of the transaction commit; however, you should set the bean's transaction attribute to Required . If you are using bean-managed transactions, the acknowledgment can't be part of the transaction commit because the JMS message receipt is out of the scope of the bean's transaction. If you are using bean-managed transactions, you can specify the acknowledge-mode in the deployment descriptor. You can specify either AUTO_ACKNOWLEDGE or DUPS_OK_ACKNOWLEDGE . If no value is specified in the acknowledge-mode tag, AUTO_ACKNOWLEDGE is the default.



Special Edition Using Enterprise JavaBeans 2.0
Special Edition Using Enterprise JavaBeans 2.0
ISBN: 0789725673
EAN: 2147483647
Year: 2000
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net