O'Reilly logo

Java Enterprise in a Nutshell, Third Edition by William Crawford, Jim Farley

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

EJB Transaction Management

In this section, we discuss some extended topics related to transaction management with EJB components. This material complements the introductory section on EJB transaction management found in Chapter 6. If you are specifically concerned with transaction management related to EJBs , we recommend that you read “Transaction Management” in Chapter 6 since it introduces the basic concepts and some general rules related to both declarative and programmatic transaction management within EJBs. Once you have that material under your belt, if you feel you need to know more, come back to this section for additional coverage.

If you’re using strictly declarative transaction management within EJBs, this is referred to as Container-Managed Transaction Demarcation (CMTD). The container is responsible for starting and committing or rolling back the transactions required by the EJB based on the directives specified in the deployment descriptor as well as some programmatic hints by the developer in the EJB code. The container leverages JTA for the transaction management under the covers.

Using programmatic transaction management within EJB components is a bit of a special case, because the EJB container has a default assumption that it is managing transactions on behalf of its components. Programmatic transaction management within EJB components is sometimes referred to as Bean-Managed Transaction Demarcation (BMTD ). If an EJB developer chooses to use BMTD in a bean, ...

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