Transactional Behavior Of Ejb Applications; Declarative Transaction Management - Red Hat APPLICATION SERVER - JONAS Manual

Jonas
Hide thumbs Also See for APPLICATION SERVER - JONAS:
Table of Contents

Advertisement

Transactional Behavior of EJB Applications

This chapter is for the Enterprise Bean provider; that is, the person in charge of developing the soft-
ware components on the server side.

11.1. Declarative Transaction Management

For container-managed transaction management, the transactional behavior of an Enterprise Bean is
defined at configuration time and is part of the assembly-descriptor element of the standard deploy-
ment descriptor. It is possible to define a common behavior for all the methods of the bean, or to define
the behavior at the method level. This is done by specifying a transactional attribute, which can be
one of the following:
NotSupported
If the method is called within a transaction, this transaction is suspended during the time of the
method execution.
Required
If the method is called within a transaction, the method is executed in the scope of this trans-
action; otherwise, a new transaction is started for the execution of the method and committed
before the method result is sent to the caller.
RequiresNew
The method will always be executed within the scope of a new transaction. The new transaction
is started for the execution of the method, and committed before the method result is sent to the
caller. If the method is called within a transaction, this transaction is suspended before the new
one is started and resumed when the new transaction has completed.
Mandatory
The method should always be called within the scope of a transaction, else the container will
throw the
TransactionRequired
Supports
The method is invoked within the caller transaction scope; if the caller does not have an associ-
ated transaction, the method is invoked without a transaction scope.
Never
The client is required to call the bean without any transaction context; if it is not the case, a
java.rmi.RemoteException is thrown by the container.
This is illustrated in the following table:
Transaction
Attribute
NotSupported
exception.
Client
transaction
-
T1
Transaction associated with
enterprise Bean's method
-
-
Chapter 11.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Application server

Table of Contents