Package org.apache.ibatis.transaction
Interface Transaction
-
- All Known Implementing Classes:
JdbcTransaction
,ManagedTransaction
public interface Transaction
Wraps 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 void
close()
Close inner database connection.void
commit()
Commit inner database connection.Connection
getConnection()
Retrieve inner database connection.Integer
getTimeout()
Get transaction timeout if set.void
rollback()
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 SQLException
Commit inner database connection.- Throws:
SQLException
- the SQL exception
-
rollback
void rollback() throws SQLException
Rollback inner database connection.- Throws:
SQLException
- the SQL exception
-
close
void close() throws SQLException
Close 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
-
-