public class XAManagedConnection extends BaseWrapperManagedConnection implements XAResource, javax.resource.spi.LocalTransaction
Modifier and Type | Field and Description |
---|---|
protected Xid |
currentXid
The Xid
|
protected XAConnection |
xaConnection
The XA connection
|
protected XAResource |
xaResource
The XAResource
|
bundle, con, destroyed, ignoreInManagedAutoCommitCalls, inLocalTransaction, inManagedTransaction, jdbcAutoCommit, jdbcReadOnly, jdbcTransactionIsolation, mcf, metadata, props, stateLock, underlyingAutoCommit, underlyingReadOnly
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
Constructor and Description |
---|
XAManagedConnection(XAManagedConnectionFactory mcf,
XAConnection xaConnection,
Properties props,
int transactionIsolation,
int psCacheSize)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
begin() |
protected void |
broadcastConnectionError(SQLException e) |
void |
commit() |
void |
commit(Xid xid,
boolean onePhase) |
void |
destroy()
Destroy
|
void |
end(Xid xid,
int flags) |
void |
forget(Xid xid) |
javax.resource.spi.LocalTransaction |
getLocalTransaction() |
int |
getTransactionTimeout() |
XAResource |
getXAResource() |
boolean |
isSameRM(XAResource other) |
boolean |
isXA()
Returns true if the underlying connection is handled by an XA resource manager
|
int |
prepare(Xid xid) |
Xid[] |
recover(int flag) |
void |
rollback() |
void |
rollback(Xid xid) |
boolean |
setTransactionTimeout(int seconds) |
void |
start(Xid xid,
int flags) |
addConnectionEventListener, associateConnection, broadcastConnectionError, checkException, checkState, cleanup, getBeginRequestNotify, getConnection, getConnection, getEndRequestNotify, getLog, getLogWriter, getMetaData, getProperties, lock, notifyRequestBegin, notifyRequestEnd, removeConnectionEventListener, setBeginRequestNotify, setConnectableResourceListener, setEndRequestNotify, setLogWriter, tryLock, unlock
protected final XAConnection xaConnection
protected final XAResource xaResource
protected Xid currentXid
public XAManagedConnection(XAManagedConnectionFactory mcf, XAConnection xaConnection, Properties props, int transactionIsolation, int psCacheSize) throws SQLException
mcf
- The managed connection factoryxaConnection
- The XA connectionprops
- The propertiestransactionIsolation
- The transaction isolationpsCacheSize
- The prepared statement cache sizeSQLException
- Thrown if an error occurspublic void begin() throws javax.resource.ResourceException
begin
in interface javax.resource.spi.LocalTransaction
javax.resource.ResourceException
public void commit() throws javax.resource.ResourceException
commit
in interface javax.resource.spi.LocalTransaction
javax.resource.ResourceException
public void rollback() throws javax.resource.ResourceException
rollback
in interface javax.resource.spi.LocalTransaction
javax.resource.ResourceException
protected void broadcastConnectionError(SQLException e)
public javax.resource.spi.LocalTransaction getLocalTransaction() throws javax.resource.ResourceException
getLocalTransaction
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
public XAResource getXAResource() throws javax.resource.ResourceException
getXAResource
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
public void destroy() throws javax.resource.ResourceException
destroy
in interface javax.resource.spi.ManagedConnection
destroy
in class BaseWrapperManagedConnection
javax.resource.ResourceException
- Thrown if an error occurspublic void start(Xid xid, int flags) throws XAException
start
in interface XAResource
XAException
public void end(Xid xid, int flags) throws XAException
end
in interface XAResource
XAException
public int prepare(Xid xid) throws XAException
prepare
in interface XAResource
XAException
public void commit(Xid xid, boolean onePhase) throws XAException
commit
in interface XAResource
XAException
public void rollback(Xid xid) throws XAException
rollback
in interface XAResource
XAException
public void forget(Xid xid) throws XAException
forget
in interface XAResource
XAException
public Xid[] recover(int flag) throws XAException
recover
in interface XAResource
XAException
public boolean isSameRM(XAResource other) throws XAException
isSameRM
in interface XAResource
XAException
public int getTransactionTimeout() throws XAException
getTransactionTimeout
in interface XAResource
XAException
public boolean setTransactionTimeout(int seconds) throws XAException
setTransactionTimeout
in interface XAResource
XAException
public boolean isXA()
isXA
in class BaseWrapperManagedConnection
Copyright © 2021 JBoss by Red Hat. All rights reserved.