|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.dbcp.managed.TransactionRegistry
public class TransactionRegistry
TransactionRegistry tracks Connections and XAResources in a transacted environment for a single XAConnectionFactory.
The TransactionRegistry hides the details of transaction processing from the existing DBCP pooling code, and gives the ManagedConnection a way to enlist connections in a transaction, allowing for the maximal rescue of DBCP.
Constructor Summary | |
---|---|
TransactionRegistry(javax.transaction.TransactionManager transactionManager)
Creates a TransactionRegistry for the specified transaction manager. |
Method Summary | |
---|---|
TransactionContext |
getActiveTransactionContext()
Gets the active TransactionContext or null if not Transaction is active. |
javax.transaction.xa.XAResource |
getXAResource(java.sql.Connection connection)
Gets the XAResource registered for the connection. |
void |
registerConnection(java.sql.Connection connection,
javax.transaction.xa.XAResource xaResource)
Registers the association between a Connection and a XAResource. |
void |
unregisterConnection(java.sql.Connection connection)
Unregisters a destroyed connection from TransactionRegistry |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransactionRegistry(javax.transaction.TransactionManager transactionManager)
transactionManager
- the transaction manager used to enlist connectionsMethod Detail |
---|
public void registerConnection(java.sql.Connection connection, javax.transaction.xa.XAResource xaResource)
connection
- the JDBC connectionxaResource
- the XAResource which managed the connection within a transactionpublic javax.transaction.xa.XAResource getXAResource(java.sql.Connection connection) throws java.sql.SQLException
connection
- the connection
java.sql.SQLException
- if the connection does not have a registered XAResourcepublic TransactionContext getActiveTransactionContext() throws java.sql.SQLException
java.sql.SQLException
- if an error occurs while fetching the transactionpublic void unregisterConnection(java.sql.Connection connection)
TransactionRegistry
connection
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |