Class ScopedTransaction

    • Method Detail

      • push

        public void push​(ScopeTrans scopeTrans)
        Push the scope transaction.
      • complete

        public void complete​(Object returnOrThrowable,
                             int opCode)
        Exiting an enhanced transactional method.
      • complete

        public void complete()
        Internal programmatic complete - finally block, try to commit.
      • end

        public void end()
                 throws javax.persistence.PersistenceException
        Description copied from interface: Transaction
        If the transaction is active then perform rollback. Otherwise do nothing.
        Throws:
        javax.persistence.PersistenceException
      • close

        public void close()
        Description copied from interface: Transaction
        Synonym for end() to support AutoClosable.
      • commit

        public void commit()
        Description copied from interface: Transaction
        Commit the transaction.

        This performs commit and completes the transaction closing underlying resources and marking the transaction as "In active".

        Functions

        • Flush the JDBC batch buffer
        • Call commit on the underlying JDBC connection
        • Trigger any registered TransactionCallbacks
        • Perform post-commit processing updating L2 cache, ElasticSearch etc
        • Close any underlying resources, closing the underlying JDBC connection
        • Mark the transaction as "Inactive"
      • rollback

        public void rollback()
                      throws javax.persistence.PersistenceException
        Description copied from interface: Transaction
        Rollback the transaction.

        This performs rollback, closes underlying resources and marks the transaction as "In active".

        Functions

        • Call rollback on the underlying JDBC connection
        • Trigger any registered TransactionCallbacks
        • Close any underlying resources, closing the underlying JDBC connection
        • Mark the transaction as "Inactive"
        Throws:
        javax.persistence.PersistenceException
      • rollback

        public void rollback​(Throwable e)
                      throws javax.persistence.PersistenceException
        Description copied from interface: Transaction
        Rollback the transaction specifying a throwable that caused the rollback to occur.

        If you are using transaction logging this will log the throwable in the transaction logs.

        Throws:
        javax.persistence.PersistenceException
      • setRollbackOnly

        public void setRollbackOnly()
        Description copied from interface: Transaction
        Mark the transaction for rollback only.