Package org.apache.ibatis.transaction
Interface Transaction
-
- All Known Implementing Classes:
JdbcTransaction,ManagedTransaction
public interface TransactionWraps a database connection. Handles the connection lifecycle that comprises: its creation, preparation, commit/rollback and close.- Author:
- Clinton Begin
-
-
Method Summary
Modifier and Type Method Description voidclose()Close inner database connection.voidcommit()Commit inner database connection.java.sql.ConnectiongetConnection()Retrieve inner database connection.java.lang.IntegergetTimeout()Get transaction timeout if set.voidrollback()Rollback inner database connection.
-
-
-
Method Detail
-
getConnection
java.sql.Connection getConnection() throws java.sql.SQLExceptionRetrieve inner database connection.- Returns:
- DataBase connection
- Throws:
java.sql.SQLException
-
commit
void commit() throws java.sql.SQLExceptionCommit inner database connection.- Throws:
java.sql.SQLException
-
rollback
void rollback() throws java.sql.SQLExceptionRollback inner database connection.- Throws:
java.sql.SQLException
-
close
void close() throws java.sql.SQLExceptionClose inner database connection.- Throws:
java.sql.SQLException
-
getTimeout
java.lang.Integer getTimeout() throws java.sql.SQLExceptionGet transaction timeout if set.- Throws:
java.sql.SQLException
-
-