Example for Developing EJB with CMT

For EJB applications with container-managed transactions, a basic transaction works in the following way:

  1. In the EJB's standard deployment descriptor, the EJB developer or assembler specifies the transaction type by setting the <transaction-type> tag with the value Container (for CMT).

  2. In the standard deployment descriptor, the EJB developer or assembler specifies the transaction attribute by setting the value of the <trans-attribute> tag to one of the following values: NotSupported, Required, Supports, RequiresNew, Mandatory, or Never. This tag enables you to set a default value for all methods of the entire EJB, or a value for each specific method of the EJB. Refer to the “Setting Transaction Attributes” section ...

Get Sams Teach Yourself EJB in 21 Days 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.