Interface TransactionManager


  • public interface TransactionManager
    Wraps given action with transaction. If an exception is thrown, then rollback is executed.
    • Method Detail

      • withTransaction

        void withTransaction​(Runnable action)
        Wraps given action with transaction. If an exception is thrown, then rollback is executed. The exception is rethrown after rollback.
        Parameters:
        action - action to be executed
      • withTransaction

        void withTransaction​(Runnable action,
                             Function<Throwable,​RuntimeException> exceptionMapper)
        Wraps given action with transaction. If an exception is thrown, then rollback is executed. After rollback, the exception is mapped into a custom exception using exceptionMapper and rethrown.
        Parameters:
        action - action to be executed
        exceptionMapper - function that maps caught exception into custom exception
      • getInstance

        static TransactionManager getInstance​(Session session)
        Creates new instance of Transaction Manager
        Parameters:
        session - snowpark session
        Returns:
        new instance