Using Transactions with Message-Driven Beans

Like other EJBs, message-driven beans make use of the EJB container's transaction service. Because message-driven beans never directly interact with clients, they never participate in the client's transaction.

Message-driven EJBs offer three different transaction options:

  • Required transaction attribute

  • NotSupported

  • Bean-managed transactions

Required Transaction Attribute

If the Required attribute is specified, the EJB container automatically starts a transaction. The message receipt from the JMS queue or topic is included in this transaction. The message-driven bean's onMessage method is then called in the transaction context. When the onMessage method returns, the EJB container commits the transaction. ...

Get J2EE™ Applications and BEA™ WebLogic Server™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.