Interface AsynchronousCommitAllowed

All Known Implementing Classes:
AdminEventEntity, AuthenticationSessionEntity, ClusterEventEntity, EventEntity, LoginFailureEntity, PersistentClientSessionEntity, PersistentUserSessionEntity, RootAuthenticationSessionEntity, SingleUseObjectEntity

public interface AsynchronousCommitAllowed
Marker interface for JPA entities that can tolerate asynchronous commit.

When a transaction only modifies entities that implement this interface (and whose isAsyncCommitAllowed(EntityOperationType) returns true for the respective operation). See AsyncCommitIntegrator for details. This is currently only supported for PostgreSQL databases.

Entities that do NOT implement this interface are considered "important" — any modification to them forces synchronous commit for the entire transaction.

Author:
Alexander Schwartz
  • Method Details

    • isAsyncCommitAllowed

      default boolean isAsyncCommitAllowed(AsynchronousCommitAllowed.EntityOperationType operationType)
      Whether this entity allows asynchronous commit for the given operation type.

      Returning false for any operation that occurs during a transaction will force synchronous commit for the entire transaction.

      Parameters:
      operationType - the type of database operation being performed
      Returns:
      true if the operation can tolerate asynchronous commit