@Documented @Inherited @Retention(value=RUNTIME) @Target(value=TYPE) public @interface TransactionAware
The primary use case for this annotation is events which are raised when a persistent entity is updated in some way. Such events may be raised while the transaction to update the entity is still in progress, but should only be published when the transaction is committed.
If a TransactionAware
event is raised while no transaction is in progress, it is always published immediately
regardless of the configuration applied by this annotation.
This setting is inherited. If a derived event does not need to be transaction aware, it may be annotated with:
@TransactionAware(TransactionAware.When.IMMEDIATE)
Such configuration indicates the event should be published immediately when it is raised, which is the same behaviour
that is applied if this annotation is not present on the event's class.
Modifier and Type | Optional Element and Description |
---|---|
TransactionAware.When |
value
Configures when the event should be dispatched, relative to the transaction lifecycle.
|
public abstract TransactionAware.When value
By default, the event will be dispatched after the transaction is committed
. This
means if the transaction does not commit, the event will not be published.
TransactionAware.When
Copyright © 2024 Atlassian. All rights reserved.