Class TransactionContextManager


  • public abstract class TransactionContextManager
    extends Object
    Delegate to register and obtain transactional contexts.

    Typically used by components that intercept or orchestrate transactional flows such as AOP interceptors or transactional operators.

    Since:
    5.2
    Author:
    Mark Paluch
    See Also:
    TransactionSynchronization
    • Method Detail

      • createTransactionContext

        public static Function<reactor.util.context.Context,​reactor.util.context.Context> createTransactionContext()
        Create a TransactionContext and register it in the subscriber Context.
        Returns:
        functional context registration.
        Throws:
        IllegalStateException - if a transaction context is already associated.
        See Also:
        Mono.subscriberContext(Function), Flux.subscriberContext(Function)
      • getOrCreateContextHolder

        public static Function<reactor.util.context.Context,​reactor.util.context.Context> getOrCreateContextHolder()
        Return a Function to create or associate a new TransactionContextHolder. Creation and release of transactions within a reactive flow requires a mutable holder that follows a top to down execution scheme. Reactor's subscriber context follows a down to top approach regarding mutation visibility.
        Returns:
        functional context registration.