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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close inner database connection.voidcommit()Commit inner database connection.ConnectiongetConnection()Retrieve inner database connection.IntegergetTimeout()Get transaction timeout if set.voidrollback()Rollback inner database connection.
-
-
-
Method Detail
-
getConnection
Connection getConnection() throws SQLException
Retrieve inner database connection.- Returns:
- DataBase connection
- Throws:
SQLException- the SQL exception
-
commit
void commit() throws SQLExceptionCommit inner database connection.- Throws:
SQLException- the SQL exception
-
rollback
void rollback() throws SQLExceptionRollback inner database connection.- Throws:
SQLException- the SQL exception
-
close
void close() throws SQLExceptionClose inner database connection.- Throws:
SQLException- the SQL exception
-
getTimeout
Integer getTimeout() throws SQLException
Get transaction timeout if set.- Returns:
- the timeout
- Throws:
SQLException- the SQL exception
-
-