Package org.jboss.jca.adapters.jdbc.xa
Class XAManagedConnection
java.lang.Object
org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection
org.jboss.jca.adapters.jdbc.xa.XAManagedConnection
- All Implemented Interfaces:
jakarta.resource.spi.LocalTransaction,jakarta.resource.spi.ManagedConnection,XAResource,org.jboss.jca.core.connectionmanager.pool.mcp.NotifyingManagedConnection,ConnectableResource
public class XAManagedConnection
extends BaseWrapperManagedConnection
implements XAResource, jakarta.resource.spi.LocalTransaction
XAManagedConnection
- Version:
- $Revision: 76313 $
- Author:
- David Jencks , Adrian Brock, Weston Price
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected XidThe Xidprotected final XAConnectionThe XA connectionprotected final XAResourceThe XAResourceFields inherited from class org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection
bundle, con, destroyed, ignoreInManagedAutoCommitCalls, inLocalTransaction, inManagedTransaction, jdbcAutoCommit, jdbcReadOnly, jdbcTransactionIsolation, mcf, metadata, props, setAutoCommitOnCleanup, stateLock, underlyingAutoCommit, underlyingReadOnlyFields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY -
Constructor Summary
ConstructorsConstructorDescriptionXAManagedConnection(XAManagedConnectionFactory mcf, XAConnection xaConnection, Properties props, int transactionIsolation, int psCacheSize) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidbegin()protected voidvoidcommit()voidvoiddestroy()Destroyvoidvoidjakarta.resource.spi.LocalTransactionintbooleanisSameRM(XAResource other) booleanisXA()Returns true if the underlying connection is handled by an XA resource managerintXid[]recover(int flag) voidrollback()voidbooleansetTransactionTimeout(int seconds) voidMethods inherited from class org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection
addConnectionEventListener, associateConnection, broadcastConnectionError, checkException, checkState, cleanup, getBeginRequestNotify, getConnection, getConnection, getEndRequestNotify, getLog, getLogWriter, getMetaData, getProperties, lock, notifyRequestBegin, notifyRequestEnd, removeConnectionEventListener, setBeginRequestNotify, setConnectableResourceListener, setEndRequestNotify, setLogWriter, tryLock, unlock
-
Field Details
-
xaConnection
The XA connection -
xaResource
The XAResource -
currentXid
The Xid
-
-
Constructor Details
-
XAManagedConnection
public XAManagedConnection(XAManagedConnectionFactory mcf, XAConnection xaConnection, Properties props, int transactionIsolation, int psCacheSize) throws SQLException Constructor- Parameters:
mcf- The managed connection factoryxaConnection- The XA connectionprops- The propertiestransactionIsolation- The transaction isolationpsCacheSize- The prepared statement cache size- Throws:
SQLException- Thrown if an error occurs
-
-
Method Details
-
begin
public void begin() throws jakarta.resource.ResourceException- Specified by:
beginin interfacejakarta.resource.spi.LocalTransaction- Throws:
jakarta.resource.ResourceException
-
commit
public void commit() throws jakarta.resource.ResourceException- Specified by:
commitin interfacejakarta.resource.spi.LocalTransaction- Throws:
jakarta.resource.ResourceException
-
rollback
public void rollback() throws jakarta.resource.ResourceException- Specified by:
rollbackin interfacejakarta.resource.spi.LocalTransaction- Throws:
jakarta.resource.ResourceException
-
broadcastConnectionError
-
getLocalTransaction
public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws jakarta.resource.ResourceException- Specified by:
getLocalTransactionin interfacejakarta.resource.spi.ManagedConnection- Throws:
jakarta.resource.ResourceException
-
getXAResource
- Specified by:
getXAResourcein interfacejakarta.resource.spi.ManagedConnection- Throws:
jakarta.resource.ResourceException
-
destroy
public void destroy() throws jakarta.resource.ResourceExceptionDestroy- Specified by:
destroyin interfacejakarta.resource.spi.ManagedConnection- Overrides:
destroyin classBaseWrapperManagedConnection- Throws:
jakarta.resource.ResourceException- Thrown if an error occurs
-
start
- Specified by:
startin interfaceXAResource- Throws:
XAException
-
end
- Specified by:
endin interfaceXAResource- Throws:
XAException
-
prepare
- Specified by:
preparein interfaceXAResource- Throws:
XAException
-
commit
- Specified by:
commitin interfaceXAResource- Throws:
XAException
-
rollback
- Specified by:
rollbackin interfaceXAResource- Throws:
XAException
-
forget
- Specified by:
forgetin interfaceXAResource- Throws:
XAException
-
recover
- Specified by:
recoverin interfaceXAResource- Throws:
XAException
-
isSameRM
- Specified by:
isSameRMin interfaceXAResource- Throws:
XAException
-
getTransactionTimeout
- Specified by:
getTransactionTimeoutin interfaceXAResource- Throws:
XAException
-
setTransactionTimeout
- Specified by:
setTransactionTimeoutin interfaceXAResource- Throws:
XAException
-
isXA
public boolean isXA()Returns true if the underlying connection is handled by an XA resource manager- Specified by:
isXAin classBaseWrapperManagedConnection- Returns:
- The value
-