Package org.mybatis.spring.transaction
Class SpringManagedTransaction
- java.lang.Object
- 
- org.mybatis.spring.transaction.SpringManagedTransaction
 
- 
- All Implemented Interfaces:
- org.apache.ibatis.transaction.Transaction
 
 public class SpringManagedTransaction extends java.lang.Object implements org.apache.ibatis.transaction.TransactionSpringManagedTransactionhandles 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.- Author:
- Hunter Presnall, Eduardo Macarron
 
- 
- 
Constructor SummaryConstructors Constructor Description SpringManagedTransaction(javax.sql.DataSource dataSource)
 - 
Method SummaryModifier and Type Method Description voidclose()voidcommit()java.sql.ConnectiongetConnection()java.lang.IntegergetTimeout()voidrollback()
 
- 
- 
- 
Method Detail- 
getConnectionpublic java.sql.Connection getConnection() throws java.sql.SQLException- Specified by:
- getConnectionin interface- org.apache.ibatis.transaction.Transaction
- Throws:
- java.sql.SQLException
 
 - 
commitpublic void commit() throws java.sql.SQLException- Specified by:
- commitin interface- org.apache.ibatis.transaction.Transaction
- Throws:
- java.sql.SQLException
 
 - 
rollbackpublic void rollback() throws java.sql.SQLException- Specified by:
- rollbackin interface- org.apache.ibatis.transaction.Transaction
- Throws:
- java.sql.SQLException
 
 - 
closepublic void close() throws java.sql.SQLException- Specified by:
- closein interface- org.apache.ibatis.transaction.Transaction
- Throws:
- java.sql.SQLException
 
 - 
getTimeoutpublic java.lang.Integer getTimeout() throws java.sql.SQLException- Specified by:
- getTimeoutin interface- org.apache.ibatis.transaction.Transaction
- Throws:
- java.sql.SQLException
 
 
- 
 
-