8.4.5 Message-driven beans and transactions
A bean provider can specify whether a message-driven bean will demarcate its own transactions programmatically or whether it will rely on the EJB container to demarcate transactions on its behalf. The bean provider does this by specifying either bean or container as the value for the transaction-type field for the message-driven bean in the EJB module deployment descriptor.
Regardless of whether transaction demarcation is bean-managed or container-managed, a message-driven bean can only access the transactional context within which it is running by using the relevant methods of the MessageDrivenContext interface.