Interface NonBlockingTransaction

All Known Implementing Classes:
AuthenticationSessionChangeLogTransaction, ClientSessionChangeLogTransaction, ClientSessionPersistentChangelogBasedTransaction, InfinispanChangelogBasedTransaction, InfinispanKeycloakTransaction, LoginFailureChangeLogTransaction, PersistentSessionsChangelogBasedTransaction, RemoteChangeLogTransaction, SingleUseObjectTransaction, UserSessionChangeLogTransaction, UserSessionPersistentChangelogBasedTransaction, UserSessionTransaction

public interface NonBlockingTransaction
Represents a non-blocking transaction.

The commit and rollback operations should not block the invoker thread and register any CompletionStage into the AggregateCompletionStage. The invoker is responsible to provide the AggregateCompletionStage and to wait for its completion.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    asyncCommit(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage, Consumer<DatabaseUpdate> databaseUpdates)
    Asynchronously commits the transaction.
    void
    asyncRollback(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage)
    Asynchronously rollbacks the transaction.
  • Method Details

    • asyncCommit

      void asyncCommit(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage, Consumer<DatabaseUpdate> databaseUpdates)
      Asynchronously commits the transaction.

      The implementation should not block the thread and add any (or none) CompletionStage into the stage.

      Any blocking operation should be consumed by the databaseUpdates. It will be executed at a later instant.

      Parameters:
      stage - The AggregateCompletionStage to collect the CompletionStage.
      databaseUpdates - The Consumer to use for blocking/database updates.
    • asyncRollback

      void asyncRollback(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage)
      Asynchronously rollbacks the transaction.

      The implementation should not block the thread and add any (or none) CompletionStage into the stage.

      Parameters:
      stage - The AggregateCompletionStage to collect the CompletionStage.