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:
javax.resource.spi.LocalTransaction,javax.resource.spi.ManagedConnection,XAResource,org.jboss.jca.core.connectionmanager.pool.mcp.NotifyingManagedConnection,ConnectableResource
public class XAManagedConnection
extends BaseWrapperManagedConnection
implements XAResource, javax.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()Destroyvoidvoidjavax.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 javax.resource.ResourceException- Specified by:
beginin interfacejavax.resource.spi.LocalTransaction- Throws:
javax.resource.ResourceException
-
commit
public void commit() throws javax.resource.ResourceException- Specified by:
commitin interfacejavax.resource.spi.LocalTransaction- Throws:
javax.resource.ResourceException
-
rollback
public void rollback() throws javax.resource.ResourceException- Specified by:
rollbackin interfacejavax.resource.spi.LocalTransaction- Throws:
javax.resource.ResourceException
-
broadcastConnectionError
-
getLocalTransaction
public javax.resource.spi.LocalTransaction getLocalTransaction() throws javax.resource.ResourceException- Specified by:
getLocalTransactionin interfacejavax.resource.spi.ManagedConnection- Throws:
javax.resource.ResourceException
-
getXAResource
- Specified by:
getXAResourcein interfacejavax.resource.spi.ManagedConnection- Throws:
javax.resource.ResourceException
-
destroy
public void destroy() throws javax.resource.ResourceExceptionDestroy- Specified by:
destroyin interfacejavax.resource.spi.ManagedConnection- Overrides:
destroyin classBaseWrapperManagedConnection- Throws:
javax.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
-