Book Image

EJB 3 Developer Guide

By : Michael Sikora
Book Image

EJB 3 Developer Guide

By: Michael Sikora

Overview of this book

Table of Contents (18 chapters)
EJB 3 Developer Guide
Credits
About the Author
About the Reviewers
Preface
Annotations and Their Corresponding Packages

Chapter 7. Transactions

In this chapter we will cover the following topics:

  • ACID properties of a transaction

  • Container-managed transactions

  • Container-managed transaction demarcation

  • Session synchronization interface

  • Doomed transactions

  • Transaction isolation levels

  • Lost update problem

  • Optimistic and pessimistic locking

  • How EJB 3 implements optimistic locking

  • Bean-managed transactions and the user transaction interface

Introduction

Up to now our examples have, for the most part, used transactions by default. Most of our examples have used container-managed transactions. As the name suggests, the transaction lifecycle is controlled by the EJB container. Container-managed transactions use the Java Transaction API, or JTA. Container-managed transactions have a default start and end point, however it is possible to configure these as we shall see later in this chapter. Java SE applications, which run outside an EJB container and so do not have JTA available, must use resource-local transactions. Resource...