Interface ContextManager

All Known Implementing Classes:

public interface ContextManager
Allows access to Context that is bound to the current thread and allows to manually create additional contexts.
  • Method Details

    • createNewContext

      Context createNewContext()
      Create a new context and attach it to the current thread.
    • createNewContext

      Context createNewContext(Connection connection)
      Create a new context using an existing connection. This can be useful in special circumstances when a context needs to use the same transaction as an already existing connection. Note: The connection is not closed when the context is closed!
    • createNewContext

      Context createNewContext(Integer queryTimeout)
    • createNewContext

      Context createNewContext(Connection connection, Integer queryTimeout)
    • setThreadContext

      Context setThreadContext(@Nullable @Nullable Context ctx)
    • getThreadContext

      Context getThreadContext()
    • clearImplicitContext

      void clearImplicitContext()
      Clear and close the implicit context. Should be called at the end of a test or request. Can also called when the implicit context is no longer needed to release the database connection.
    • addContextCreationListener

      void addContextCreationListener(ContextCreationListener l)
    • removeContextCreationListener

      void removeContextCreationListener(ContextCreationListener l)
    • newContext

      default Invoker newContext()