Interface CommitListener
public interface CommitListener
Event listener that will be called before/after a transaction commit.
Can be registered through
PersistenceSession.addCommitListener(CommitListener)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
default boolean
onAfterFlush
(TransactionControl transaction) Called afterEntityTransactionContext.executeEntityOperations()
andSession.flush()
has been called.default void
onBeforeCommit
(TransactionControl transaction) default int
priority()
Defines the ordering of commit listeners, lower numbers will be executed first
-
Field Details
-
DEFAULT_PRIORITY
static final int DEFAULT_PRIORITY- See Also:
-
SYSTEM_PRIORITY
static final int SYSTEM_PRIORITY- See Also:
-
-
Method Details
-
onBeforeCommit
-
onAfterFlush
Called afterEntityTransactionContext.executeEntityOperations()
andSession.flush()
has been called. This means that all INSERT and UPDATE statements have already been executed, but the transaction is not committed yet.- Returns:
- true if the session should be flushed after this listener (e.g. if this listener modifies the database)
-
onAfterCommit
default void onAfterCommit() -
priority
default int priority()Defines the ordering of commit listeners, lower numbers will be executed first
-