O'Reilly logo

Java EE 6 with GlassFish 3 Application Server by David R. Heffelfinger

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

Transactions in Enterprise JavaBeans

Like we mentioned earlier in this chapter, any EJB methods are automatically wrapped in a transaction by default. This default behavior is known as container-managed transactions, as transactions are managed by the EJB container. Application developers may also choose to manage transactions themselves. This can be accomplished by using bean-managed transactions. Both these approaches are discussed in the following sections:

Container-managed transactions

As EJB methods are transactional by default, we run into an interesting dilemma when a session bean is invoked from the client code that is already in a transaction. How should the EJB container behave? Should it suspend the client transaction, execute its method ...

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