public class TransactionRegistry
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Map |
caches |
private javax.transaction.TransactionManager |
transactionManager |
private java.util.Map |
xaResources |
Constructor and Description |
---|
TransactionRegistry(javax.transaction.TransactionManager transactionManager)
Creates a TransactionRegistry for the specified transaction manager.
|
Modifier and Type | Method and Description |
---|---|
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 |
private final javax.transaction.TransactionManager transactionManager
private final java.util.Map caches
private final java.util.Map xaResources
public TransactionRegistry(javax.transaction.TransactionManager transactionManager)
transactionManager
- the transaction manager used to enlist connectionspublic 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 connectionjava.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
-