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) |
public SpringManagedTransaction(DataSource dataSource)
public Connection getConnection() throws SQLException
getConnection
in interface org.apache.ibatis.transaction.Transaction
SQLException
public void commit() throws SQLException
commit
in interface org.apache.ibatis.transaction.Transaction
SQLException
public void rollback() throws SQLException
rollback
in interface org.apache.ibatis.transaction.Transaction
SQLException
public void close() throws SQLException
close
in interface org.apache.ibatis.transaction.Transaction
SQLException
Copyright © 2010–2015 MyBatis.org. All rights reserved.