-
@Target(value={METHOD,TYPE}) @Retention(value=RUNTIME) public @interface TransactionAttribute
TheTransactionAttribute
annotation specifies whether the container is to invoke a business method within a transaction context. TheTransactionAttribute
annotation can be used for session beans and message driven beans. It can only be specified if container managed transaction demarcation is used.The annotation can be specified on the bean class and/or it can be specified on methods of the class that are methods of the business interface or no-interface view.
Specifying the
TransactionAttribute
annotation on the bean class means that it applies to all applicable business methods of the class. Specifying the annotation on a method applies it to that method only. If the annotation is applied at both the class and the method level, the method value overrides if the two disagree.The values of the
TransactionAttribute
annotation are defined by the enumTransactionAttributeType
. If theTransactionAttribute
annotation is not specified, and the bean uses container managed transaction demarcation, the semantics of theREQUIRED
transaction attribute are assumed.- Since:
- EJB 3.0
- See Also:
TransactionAttributeType
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element and Description TransactionAttributeType
value
-
-
-
Element Detail
-
value
public abstract TransactionAttributeType value
- Default:
- javax.ejb.TransactionAttributeType.REQUIRED
-
-
Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/ejb/TransactionAttribute.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.