|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.ibatis.transaction.jdbc.JdbcTransaction
public class JdbcTransaction
Transaction that makes use of the JDBC commit and rollback facilities directly.
It relies on the connection retrieved from the dataSource to manage the scope of the transaction.
Delays connection retrieval until getConnection() is called.
Ignores commit or rollback requests when autocommit is on.
JdbcTransactionFactory| Field Summary | |
|---|---|
protected boolean |
autoCommmit
|
protected Connection |
connection
|
protected DataSource |
dataSource
|
protected TransactionIsolationLevel |
level
|
| Constructor Summary | |
|---|---|
JdbcTransaction(Connection connection)
|
|
JdbcTransaction(DataSource ds,
TransactionIsolationLevel desiredLevel,
boolean desiredAutoCommit)
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Connection connection
protected DataSource dataSource
protected TransactionIsolationLevel level
protected boolean autoCommmit
| Constructor Detail |
|---|
public JdbcTransaction(DataSource ds,
TransactionIsolationLevel desiredLevel,
boolean desiredAutoCommit)
public JdbcTransaction(Connection connection)
| Method Detail |
|---|
public Connection getConnection()
throws SQLException
Transaction
getConnection in interface TransactionSQLException
public void commit()
throws SQLException
Transaction
commit in interface TransactionSQLException
public void rollback()
throws SQLException
Transaction
rollback in interface TransactionSQLException
public void close()
throws SQLException
Transaction
close in interface TransactionSQLExceptionprotected void setDesiredAutoCommit(boolean desiredAutoCommit)
protected void resetAutoCommit()
protected void openConnection()
throws SQLException
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||