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
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 Details
-
getConnection
Retrieve inner database connection.- Returns:
- DataBase connection
- Throws:
SQLException
- the SQL exception
-
commit
Commit inner database connection.- Throws:
SQLException
- the SQL exception
-
rollback
Rollback inner database connection.- Throws:
SQLException
- the SQL exception
-
close
Close inner database connection.- Throws:
SQLException
- the SQL exception
-
getTimeout
Get transaction timeout if set.- Returns:
- the timeout
- Throws:
SQLException
- the SQL exception
-