public class JdbcTransaction extends Object implements Transaction
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoCommmit |
protected Connection |
connection |
protected DataSource |
dataSource |
protected TransactionIsolationLevel |
level |
Constructor and Description |
---|
JdbcTransaction(Connection connection) |
JdbcTransaction(DataSource ds,
TransactionIsolationLevel desiredLevel,
boolean desiredAutoCommit) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close inner database connection.
|
void |
commit()
Commit inner database connection.
|
Connection |
getConnection()
Retrieve inner database connection
|
protected void |
openConnection() |
protected void |
resetAutoCommit() |
void |
rollback()
Rollback inner database connection.
|
protected void |
setDesiredAutoCommit(boolean desiredAutoCommit) |
protected Connection connection
protected DataSource dataSource
protected TransactionIsolationLevel level
protected boolean autoCommmit
public JdbcTransaction(DataSource ds, TransactionIsolationLevel desiredLevel, boolean desiredAutoCommit)
public JdbcTransaction(Connection connection)
public Connection getConnection() throws SQLException
Transaction
getConnection
in interface Transaction
SQLException
public void commit() throws SQLException
Transaction
commit
in interface Transaction
SQLException
public void rollback() throws SQLException
Transaction
rollback
in interface Transaction
SQLException
public void close() throws SQLException
Transaction
close
in interface Transaction
SQLException
protected void setDesiredAutoCommit(boolean desiredAutoCommit)
protected void resetAutoCommit()
protected void openConnection() throws SQLException
SQLException
Copyright © 2010–2015 MyBatis.org. All rights reserved.