|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectorg.apache.commons.dbcp.managed.TransactionContext
public class TransactionContext
TransactionContext represents the association between a single XAConnectionFactory and a Transaction. This context contains a single shared connection which should be used by all ManagedConnections for the XAConnectionFactory, the ability to listen for the transaction completion event, and a method to check the status of the transaction.
| Constructor Summary | |
|---|---|
TransactionContext(TransactionRegistry transactionRegistry,
javax.transaction.Transaction transaction)
Creates a TransactionContext for the specified Transaction and TransactionRegistry. |
|
| Method Summary | |
|---|---|
void |
addTransactionContextListener(TransactionContextListener listener)
Adds a listener for transaction completion events. |
java.sql.Connection |
getSharedConnection()
Gets the connection shared by all ManagedConnections in the transaction. |
boolean |
isActive()
True if the transaction is active or marked for rollback only. |
void |
setSharedConnection(java.sql.Connection sharedConnection)
Sets the shared connection for this transaction. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TransactionContext(TransactionRegistry transactionRegistry,
javax.transaction.Transaction transaction)
transactionRegistry - the TransactionRegistry used to obtain the XAResource for the
shared connectiontransaction - the transaction| Method Detail |
|---|
public void addTransactionContextListener(TransactionContextListener listener)
throws java.sql.SQLException
listener - the listener to add
java.sql.SQLException - if a problem occurs adding the listener to the transactionpublic java.sql.Connection getSharedConnection()
public boolean isActive()
throws java.sql.SQLException
java.sql.SQLException - if a problem occurs obtaining the transaction status
public void setSharedConnection(java.sql.Connection sharedConnection)
throws java.sql.SQLException
sharedConnection - the shared connection
java.sql.SQLException - if a shared connection is already set, if XAResource for the connection
could not be found in the transaction registry, or if there was a problem enlisting the
connection in the transaction
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||