-
@Retention(value=RUNTIME) @Target(value={TYPE,METHOD,FIELD}) @NormalScope(passivating=true) public @interface TransactionScoped
The javax.transaction.TransactionScoped annotation provides the ability to specify a standard CDI scope to define bean instances whose lifecycle is scoped to the currently active JTA transaction. This annotation has no effect on classes which have non-contextual references such those defined as managed beans by the Java EE specification.
The transaction scope is active when the return from a call toUserTransaction.getStatus
orTransactionManager.getStatus
is one of the following states:- Status.STATUS_ACTIVE
- Status.STATUS_MARKED_ROLLBACK
- Status.STATUS_PREPARED
- Status.STATUS_UNKNOWN
- Status.STATUS_PREPARING
- Status.STATUS_COMMITTING
- Status.STATUS_ROLLING_BACK
It is not intended that the term "active" as defined here in relation to the TransactionScoped annotation should also apply to its use in relation to transaction context, lifecycle, etc. mentioned elsewhere in this specification. The object with this annotation will be associated with the current active JTA transaction when the object is used. This association must be retained through any transaction suspend or resume calls as well as any
Synchronization.beforeCompletion
callbacks. AnySynchronization.afterCompletion
methods will be invoked in an undefined context. The way in which the JTA transaction is begun and completed (for example via UserTransaction, Transactional interceptor, etc.) is of no consequence. The contextual references used across different JTA transactions are distinct. Refer to the CDI specification for more details on contextual references. Ajavax.enterprise.context.ContextNotActiveException
will be thrown if an object with this annotation is used when the transaction context is not active.- Since:
- JTA1.2
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/transaction/TransactionScoped.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.