Class TransactionalSupport

java.lang.Object
org.springframework.data.couchbase.core.TransactionalSupport

@Internal public class TransactionalSupport extends Object
Utility methods to support transactions.
Author:
Graham Pople
  • Constructor Details

    • TransactionalSupport

      public TransactionalSupport()
  • Method Details

    • checkForTransactionInThreadLocalStorage

      public static reactor.core.publisher.Mono<Optional<CouchbaseResourceHolder>> checkForTransactionInThreadLocalStorage()
      Returns non-empty iff in a transaction. It determines this from thread-local storage and/or reactive context.

      The user could be doing a reactive operation (with .block()) inside a blocking transaction (like @Transactional). Or a blocking operation inside a ReactiveTransactionsWrapper transaction (which would be a bad idea). So, need to check both thread-local storage and reactive context.

    • verifyNotInTransaction

      public static reactor.core.publisher.Mono<Void> verifyNotInTransaction(String methodName)
    • retryTransactionOnCasMismatch

      public static RuntimeException retryTransactionOnCasMismatch(com.couchbase.client.core.transaction.CoreTransactionAttemptContext ctx, long cas1, long cas2)