Java Reference
In-Depth Information
You used
@TransactionAttribute
to specify that the transaction attribute for a bean
method be
REQUIRES_NEW
. If you want to override it to use
REQUIRED
, then use the
following descriptor:
In this example, the
assembly-descriptor
element is used to specify a transaction
attribute . In addition, the
ejb-name
element in the assembly descriptor matches
the original name specified with the
@Stateless
annotation in the bean class.
13.3.5. Specifying default interceptors
an elegant manner. An interceptor can be defined at the class or method level, or a default
interceptor can be defined at the module level for all EJB classes in the EJB-JAR. We men-
tioned that default interceptors for an EJB module can only be defined in the ejb-jar.xml
deployment descriptor. The following listing shows how to specify default interceptors for
an EJB module.
Listing 13.6. Default interceptor setting in ejb-jar.xml