Message-driven beans - transaction support
Message-driven beans can handle messages on destinations (or endpoints) within the scope of a transaction.
Destination transaction handling
If transaction handling is specified for a destination, the message-driven bean starts a global transaction before it reads any incoming message from that destination. When the message-driven bean processing has finished, it commits or rolls back the transaction (using JTA transaction control).
All messages retrieved from a specific destination have the same transactional behavior.
If messages are queued to be sent within a global transaction they are sent when the transaction is committed. If the processing of a message causes the transaction to be rolled back, then the message that caused the bean instance to be invoked is left on the JMS destination.
Inbound resource adapter transaction handling
A message-driven bean can be set up to either have Bean or Container transaction handling. The resource adapter owner must tell the message-driven bean developer how to set up the message-driven bean for transaction handling.