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
Fields Modifier and Type Field Description protected XidcurrentXidThe Xidprotected XAConnectionxaConnectionThe XA connectionprotected XAResourcexaResourceThe XAResource-
Fields inherited from class org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection
bundle, con, destroyed, ignoreInManagedAutoCommitCalls, inLocalTransaction, inManagedTransaction, jdbcAutoCommit, jdbcReadOnly, jdbcTransactionIsolation, mcf, metadata, props, setAutoCommitOnCleanup, stateLock, underlyingAutoCommit, underlyingReadOnly
-
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
-
-
Constructor Summary
Constructors Constructor Description XAManagedConnection(XAManagedConnectionFactory mcf, XAConnection xaConnection, Properties props, int transactionIsolation, int psCacheSize)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbegin()protected voidbroadcastConnectionError(SQLException e)voidcommit()voidcommit(Xid xid, boolean onePhase)voiddestroy()Destroyvoidend(Xid xid, int flags)voidforget(Xid xid)javax.resource.spi.LocalTransactiongetLocalTransaction()intgetTransactionTimeout()XAResourcegetXAResource()booleanisSameRM(XAResource other)booleanisXA()Returns true if the underlying connection is handled by an XA resource managerintprepare(Xid xid)Xid[]recover(int flag)voidrollback()voidrollback(Xid xid)booleansetTransactionTimeout(int seconds)voidstart(Xid xid, int flags)-
Methods 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 Detail
-
xaConnection
protected final XAConnection xaConnection
The XA connection
-
xaResource
protected final XAResource xaResource
The XAResource
-
currentXid
protected Xid currentXid
The Xid
-
-
Constructor Detail
-
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 Detail
-
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
protected void broadcastConnectionError(SQLException e)
-
getLocalTransaction
public javax.resource.spi.LocalTransaction getLocalTransaction() throws javax.resource.ResourceException- Specified by:
getLocalTransactionin interfacejavax.resource.spi.ManagedConnection- Throws:
javax.resource.ResourceException
-
getXAResource
public XAResource getXAResource() throws javax.resource.ResourceException
- 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
public void start(Xid xid, int flags) throws XAException
- Specified by:
startin interfaceXAResource- Throws:
XAException
-
end
public void end(Xid xid, int flags) throws XAException
- Specified by:
endin interfaceXAResource- Throws:
XAException
-
prepare
public int prepare(Xid xid) throws XAException
- Specified by:
preparein interfaceXAResource- Throws:
XAException
-
commit
public void commit(Xid xid, boolean onePhase) throws XAException
- Specified by:
commitin interfaceXAResource- Throws:
XAException
-
rollback
public void rollback(Xid xid) throws XAException
- Specified by:
rollbackin interfaceXAResource- Throws:
XAException
-
forget
public void forget(Xid xid) throws XAException
- Specified by:
forgetin interfaceXAResource- Throws:
XAException
-
recover
public Xid[] recover(int flag) throws XAException
- Specified by:
recoverin interfaceXAResource- Throws:
XAException
-
isSameRM
public boolean isSameRM(XAResource other) throws XAException
- Specified by:
isSameRMin interfaceXAResource- Throws:
XAException
-
getTransactionTimeout
public int getTransactionTimeout() throws XAException- Specified by:
getTransactionTimeoutin interfaceXAResource- Throws:
XAException
-
setTransactionTimeout
public boolean setTransactionTimeout(int seconds) throws XAException- 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
-
-