|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.midao.jdbc.core.transaction.BaseTransactionHandler
public class BaseTransactionHandler
Base TransactionHandler implementation.
Is responsible for keeping session configuration and managing
connection.
Is initialized with DataSource/Connection.
Allows retrieval of Connection, but this connection is wrapped in Proxy and Connection.close()
won't be invoked on it (unless it would be explicitly cast to Implementation class)
Constructor Summary | |
---|---|
BaseTransactionHandler(java.sql.Connection conn)
Creates new BaseTransactionHandler instance |
|
BaseTransactionHandler(javax.sql.DataSource ds)
Creates new BaseTransactionHandler instance |
Method Summary | |
---|---|
void |
closeConnection()
Informs Transaction Handler that connection is no longer used. |
void |
commit()
Commits current Transaction Usable only when TransactionHandler.setManualMode(boolean) set as true |
java.sql.Connection |
getConnection()
Returns wrapped(proxy) connection. |
java.lang.Integer |
getIsolationLevel()
Returns current Transaction Isolation level |
boolean |
getManualMode()
Returns current Transaction mode |
TransactionHandler |
newInstance(java.sql.Connection conn)
Creates new TransactionHandler instance. |
TransactionHandler |
newInstance(javax.sql.DataSource ds)
Creates new TransactionHandler instance. |
void |
releaseSavepoint(java.sql.Savepoint savepoint)
Removes the specified Savepoint and subsequent Savepoint objects from the current transaction. |
void |
rollback()
Rollbacks current Transaction Usable only when TransactionHandler.setManualMode(boolean) set as true |
void |
rollback(java.sql.Savepoint savepoint)
Undoes all changes made after the given Savepoint object was set. |
void |
setIsolationLevel(java.lang.Integer level)
Transaction Isolation level. |
void |
setManualMode(boolean manualMode)
Allows switching on/off Manual Transaction mode. |
java.sql.Savepoint |
setSavepoint()
Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it. |
java.sql.Savepoint |
setSavepoint(java.lang.String name)
Creates a savepoint with the given name in the current transaction and returns the new Savepoint object that represents it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseTransactionHandler(java.sql.Connection conn)
conn
- SQL Connectionpublic BaseTransactionHandler(javax.sql.DataSource ds)
ds
- SQL DataSourceMethod Detail |
---|
public TransactionHandler newInstance(java.sql.Connection conn)
newInstance
in interface TransactionHandler
conn
- SQL Connection
public TransactionHandler newInstance(javax.sql.DataSource ds)
newInstance
in interface TransactionHandler
ds
- SQL DataSource
public void setManualMode(boolean manualMode)
setManualMode
in interface TransactionHandler
manualMode
- new Transaction Modepublic boolean getManualMode()
getManualMode
in interface TransactionHandler
public void setIsolationLevel(java.lang.Integer level)
setIsolationLevel
in interface TransactionHandler
level
- Transaction Isolation levelpublic java.lang.Integer getIsolationLevel()
getIsolationLevel
in interface TransactionHandler
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface TransactionHandler
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic void closeConnection()
closeConnection
in interface TransactionHandler
public void commit() throws java.sql.SQLException
TransactionHandler.setManualMode(boolean)
set as true
commit
in interface TransactionHandler
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic void rollback() throws java.sql.SQLException
TransactionHandler.setManualMode(boolean)
set as true
rollback
in interface TransactionHandler
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic java.sql.Savepoint setSavepoint() throws java.sql.SQLException
Connection.setSavepoint()
Usable only when TransactionHandler.setManualMode(boolean)
set as true
setSavepoint
in interface TransactionHandler
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic java.sql.Savepoint setSavepoint(java.lang.String name) throws java.sql.SQLException
Connection.setSavepoint(String)
Usable only when TransactionHandler.setManualMode(boolean)
set as true
setSavepoint
in interface TransactionHandler
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
Connection.releaseSavepoint(java.sql.Savepoint)
Usable only when TransactionHandler.setManualMode(boolean)
set as true
releaseSavepoint
in interface TransactionHandler
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
Connection.rollback(java.sql.Savepoint)
Usable only when TransactionHandler.setManualMode(boolean)
set as true
rollback
in interface TransactionHandler
java.sql.SQLException
- if exception would be thrown by Driver/Database
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |