Acknowledging Messages from Message-Driven BeansYou 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. |