Package me.danwi.sqlex.core.transaction
Class DefaultTransactionManager.DefaultTransaction
- java.lang.Object
-
- me.danwi.sqlex.core.transaction.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 voidclose()voidcommit()提交当前事务java.sql.ConnectiongetConnection()获取当前事务的数据库连接voidrollback()回滚当前事务
-
-
-
Method Detail
-
getConnection
public java.sql.Connection getConnection()
Description copied from interface:Transaction获取当前事务的数据库连接- Specified by:
getConnectionin interfaceTransaction- Returns:
- 数据库连接
-
commit
public void commit()
Description copied from interface:Transaction提交当前事务- Specified by:
commitin interfaceTransaction
-
rollback
public void rollback()
Description copied from interface:Transaction回滚当前事务- Specified by:
rollbackin interfaceTransaction
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-