public class SpringManagedTransaction extends Object implements org.apache.ibatis.transaction.Transaction
SpringManagedTransaction handles the lifecycle of a JDBC connection.
It retrieves a connection from Spring's transaction manager and returns it back to it
when it is no longer needed.
If Spring's transaction handling is active it will no-op all commit/rollback/close calls assuming that the Spring transaction manager will do the job.
If it is not it will behave like JdbcTransaction.
| Constructor and Description |
|---|
SpringManagedTransaction(DataSource dataSource) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
commit() |
Connection |
getConnection() |
Integer |
getTimeout() |
void |
rollback() |
public SpringManagedTransaction(DataSource dataSource)
public Connection getConnection() throws SQLException
getConnection in interface org.apache.ibatis.transaction.TransactionSQLExceptionpublic void commit()
throws SQLException
commit in interface org.apache.ibatis.transaction.TransactionSQLExceptionpublic void rollback()
throws SQLException
rollback in interface org.apache.ibatis.transaction.TransactionSQLExceptionpublic void close()
close in interface org.apache.ibatis.transaction.Transactionpublic Integer getTimeout()
getTimeout in interface org.apache.ibatis.transaction.TransactionCopyright © 2010–2019 MyBatis.org. All rights reserved.