Class DefaultTransactionManager.DefaultTransaction

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, Transaction
    Enclosing class:
    DefaultTransactionManager

    public class DefaultTransactionManager.DefaultTransaction
    extends java.lang.Object
    implements Transaction
    默认事务
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultTransaction​(java.sql.Connection connection, java.lang.Integer desiredIsolationLevel)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void commit()
      提交当前事务
      java.sql.Connection getConnection()
      获取当前事务的数据库连接
      void rollback()
      回滚当前事务
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultTransaction

        public DefaultTransaction​(java.sql.Connection connection,
                                  java.lang.Integer desiredIsolationLevel)
    • Method Detail

      • getConnection

        public java.sql.Connection getConnection()
        Description copied from interface: Transaction
        获取当前事务的数据库连接
        Specified by:
        getConnection in interface Transaction
        Returns:
        数据库连接
      • commit

        public void commit()
        Description copied from interface: Transaction
        提交当前事务
        Specified by:
        commit in interface Transaction
      • rollback

        public void rollback()
        Description copied from interface: Transaction
        回滚当前事务
        Specified by:
        rollback in interface Transaction
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable