O'Reilly logo

EJB 3.1 Cookbook by Richard M. Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding how the TransactionAttributeType affects transactions

The TransactionAttributeType attribute is used with the @TransactionAttribute annotation. It can be assigned one of six possible values which controls the creation and use of transactions. In this recipe, we will use the SessionSynchronization interface to illustrate how the TransactionAttributeType element works.

Getting ready

The use of CMT is effected by:

  1. Using the @TransactionManagement annotation for the class
  2. Using the TransactionManagementType.CONTAINER element, as part of the above annotation, to specify that CMT is being used
  3. Using the @TransactionAttribute annotation at the class or method level to specify the scope of the transaction

    The @TransactionAttribute annotation, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required