Class LocalTransactionHandler.BoundLocalTransactionHandler

    • Field Detail

      • savepoints

        private final java.util.Map<java.lang.String,​java.sql.Savepoint> savepoints
      • initialAutocommit

        private boolean initialAutocommit
      • didBegin

        private boolean didBegin
      • didTxnRollback

        private boolean didTxnRollback
    • Constructor Detail

      • BoundLocalTransactionHandler

        BoundLocalTransactionHandler​(Handle handle)
                              throws java.sql.SQLException
        Throws:
        java.sql.SQLException
    • Method Detail

      • begin

        public void begin​(Handle handle)
        Description copied from interface: TransactionHandler
        Begin a transaction.
        Specified by:
        begin in interface TransactionHandler
        Parameters:
        handle - the handle the transaction is being started on
      • commit

        public void commit​(Handle handle)
        Description copied from interface: TransactionHandler
        Commit the transaction.
        Specified by:
        commit in interface TransactionHandler
        Parameters:
        handle - the handle the commit is being performed on
      • rollback

        public void rollback​(Handle handle)
        Description copied from interface: TransactionHandler
        Roll back the transaction.
        Specified by:
        rollback in interface TransactionHandler
        Parameters:
        handle - the handle the rollback is being performed on
      • savepoint

        public void savepoint​(Handle handle,
                              java.lang.String name)
        Description copied from interface: TransactionHandler
        Create a new savepoint.
        Specified by:
        savepoint in interface TransactionHandler
        Parameters:
        handle - the handle on which the transaction is being savepointed
        name - The name of the savepoint, used to rollback to or release later
      • releaseSavepoint

        public void releaseSavepoint​(Handle handle,
                                     java.lang.String name)
        Description copied from interface: TransactionHandler
        Release a previously created savepoint.
        Specified by:
        releaseSavepoint in interface TransactionHandler
        Parameters:
        handle - the handle on which the savepoint is being released
        name - the savepoint to release
      • rollbackToSavepoint

        public void rollbackToSavepoint​(Handle handle,
                                        java.lang.String name)
        Description copied from interface: TransactionHandler
        Roll back to a named savepoint.
        Specified by:
        rollbackToSavepoint in interface TransactionHandler
        Parameters:
        handle - the handle the rollback is being performed on
        name - the name of the savepoint to rollback to
      • isInTransaction

        public boolean isInTransaction​(Handle handle)
        Description copied from interface: TransactionHandler
        Returns whether a given Handle is in the transaction.
        Specified by:
        isInTransaction in interface TransactionHandler
        Parameters:
        handle - the handle to test
        Returns:
        whether the given handle is in a transaction
      • inTransaction

        public <R,​X extends java.lang.Exception> R inTransaction​(Handle handle,
                                                                       HandleCallback<R,​X> callback)
                                                                throws X extends java.lang.Exception
        Description copied from interface: TransactionHandler
        Run a transaction.
        Specified by:
        inTransaction in interface TransactionHandler
        Type Parameters:
        R - the callback return type
        X - the exception type thrown by the callback, if any
        Parameters:
        handle - the handle to the database
        callback - a callback which will receive the open handle, in a transaction.
        Returns:
        the value returned by the callback.
        Throws:
        X - any exception thrown by the callback.
        X extends java.lang.Exception
        See Also:
        Handle.inTransaction(HandleCallback)
      • inTransaction

        public <R,​X extends java.lang.Exception> R inTransaction​(Handle handle,
                                                                       TransactionIsolationLevel level,
                                                                       HandleCallback<R,​X> callback)
                                                                throws X extends java.lang.Exception
        Description copied from interface: TransactionHandler
        Run a transaction.
        Specified by:
        inTransaction in interface TransactionHandler
        Type Parameters:
        R - the callback return type
        X - the exception type thrown by the callback, if any
        Parameters:
        handle - the handle to the database
        level - the isolation level for the transaction
        callback - a callback which will receive the open handle, in a transaction.
        Returns:
        the value returned by the callback.
        Throws:
        X - any exception thrown by the callback.
        X extends java.lang.Exception
        See Also:
        Handle.inTransaction(TransactionIsolationLevel, HandleCallback)
      • restoreAutoCommitState

        private void restoreAutoCommitState​(Handle handle)