Chapter 6. Transaction Processing

In this chapter, we will cover:

  • Creating the Demonstration classes
  • Handling transactions the easy way
  • Using the SessionSynchronization interface with session beans
  • Understanding how the TransactionAttributeType affects transactions
  • Handling transactions manually
  • Rolling back a transaction
  • Handling errors in a transaction
  • Using timeouts with transactions


Transactions are concerned with the execution of a sequence of database operations which execute to completion or, if there is a problem, any changes made are reversed and the database is restored to its initial state. The process of restoring the database to its initial state is called rolling back the transaction. A transaction is considered to be an indivisible ...

Get EJB 3.1 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.