public class JdbcXAConnection extends TraceObject implements XAConnection, XAResource
ARRAY, BLOB, CALLABLE_STATEMENT, CLOB, CONNECTION, DATA_SOURCE, DATABASE_META_DATA, PARAMETER_META_DATA, PREPARED_STATEMENT, RESULT_SET, RESULT_SET_META_DATA, SAVEPOINT, SQL_EXCEPTION, STATEMENT, trace, XA_DATA_SOURCE, XA_RESOURCE, XID
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
Modifier and Type | Method and Description |
---|---|
void |
addConnectionEventListener(ConnectionEventListener listener)
Register a new listener for the connection.
|
void |
close()
Close the physical connection.
|
void |
commit(Xid xid,
boolean onePhase)
Commit a transaction.
|
void |
end(Xid xid,
int flags)
End a transaction.
|
void |
forget(Xid xid)
Forget a transaction.
|
Connection |
getConnection()
Get a connection that is a handle to the physical connection.
|
int |
getTransactionTimeout()
Get the transaction timeout.
|
XAResource |
getXAResource()
Get the XAResource object.
|
boolean |
isSameRM(XAResource xares)
Checks if this is the same XAResource.
|
int |
prepare(Xid xid)
Prepare a transaction.
|
Xid[] |
recover(int flag)
Get the list of prepared transaction branches.
|
void |
removeConnectionEventListener(ConnectionEventListener listener)
Remove the event listener.
|
void |
rollback(Xid xid)
Roll back a transaction.
|
boolean |
setTransactionTimeout(int seconds)
Set the transaction timeout.
|
void |
start(Xid xid,
int flags)
Start or continue to work on a transaction.
|
String |
toString()
INTERNAL
|
debugCode, debugCodeAssign, debugCodeCall, debugCodeCall, debugCodeCall, getNextId, getTrace, getTraceId, getTraceObjectName, isDebugEnabled, isInfoEnabled, logAndConvert, quote, quoteArray, quoteBigDecimal, quoteBytes, quoteDate, quoteIntArray, quoteMap, quoteTime, quoteTimestamp, setTrace, unsupported
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addStatementEventListener, removeStatementEventListener
public XAResource getXAResource()
getXAResource
in interface XAConnection
public void close() throws SQLException
close
in interface PooledConnection
SQLException
public Connection getConnection() throws SQLException
getConnection
in interface PooledConnection
SQLException
public void addConnectionEventListener(ConnectionEventListener listener)
addConnectionEventListener
in interface PooledConnection
listener
- the event listenerpublic void removeConnectionEventListener(ConnectionEventListener listener)
removeConnectionEventListener
in interface PooledConnection
listener
- the event listenerpublic int getTransactionTimeout()
getTransactionTimeout
in interface XAResource
public boolean setTransactionTimeout(int seconds)
setTransactionTimeout
in interface XAResource
seconds
- ignoredpublic boolean isSameRM(XAResource xares)
isSameRM
in interface XAResource
xares
- the other objectpublic Xid[] recover(int flag) throws XAException
recover
in interface XAResource
flag
- TMSTARTRSCAN, TMENDRSCAN, or TMNOFLAGS. If no other flags are set,
TMNOFLAGS must be used.XAException
public int prepare(Xid xid) throws XAException
prepare
in interface XAResource
xid
- the transaction idXAException
public void forget(Xid xid)
forget
in interface XAResource
xid
- the transaction idpublic void rollback(Xid xid) throws XAException
rollback
in interface XAResource
xid
- the transaction idXAException
public void end(Xid xid, int flags) throws XAException
end
in interface XAResource
xid
- the transaction idflags
- TMSUCCESS, TMFAIL, or TMSUSPENDXAException
public void start(Xid xid, int flags) throws XAException
start
in interface XAResource
xid
- the transaction idflags
- TMNOFLAGS, TMJOIN, or TMRESUMEXAException
public void commit(Xid xid, boolean onePhase) throws XAException
commit
in interface XAResource
xid
- the transaction idonePhase
- use a one-phase protocol if trueXAException
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.