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

Using interceptors to handle transactions

Transaction processing is used in many applications. However, the implementation of transactions can clutter up business logic. The use of declarative annotations can make transaction processing easier to use. But there are still times when programmatic transaction is necessary such as with long running transactions. When it is, interceptors can be useful.

Getting ready

The essential steps to use interceptors for handling transactions include:

  1. Creating a transaction interceptor
  2. Annotating the target class to use bean-managed transactions
  3. Annotating the target method with the transaction interceptor

    The Handling transactions manually recipe in Chapter 6 explains how to implement bean managed transactions.

How ...

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