Class StubThreadLocalTransactionManager

All Implemented Interfaces:
ThreadLocalContextTransactionManager, TransactionManager

public class StubThreadLocalTransactionManager extends AbstractThreadLocalTransactionManager<SimpleTransaction>
A stub transaction manager that assumes no underlying database and thread local transaction management.
  • Constructor Details

    • StubThreadLocalTransactionManager

      public StubThreadLocalTransactionManager()
  • Method Details

    • inTransactionReturnsThrows

      public <T, E extends Exception> T inTransactionReturnsThrows(ThrowingTransactionalSupplier<T,E> work) throws E
      Description copied from interface: TransactionManager
      Should do any work necessary to start a (new) transaction, call work and then either commit on success or rollback on failure, flushing and closing any prepared statements prior to a commit and firing post commit hooks immediately afterwards.
      Type Parameters:
      T - The type returned.
      E - The exception type.
      Parameters:
      work - Code which must be called while the transaction is active.
      Returns:
      The result of supplier.
      Throws:
      E - If any exception is thrown by Runnable.