JdbcXAConnectionThis class provides support for distributed transactions. An application developer usually does not use this interface. It is used by the transaction manager internally.
void addConnectionEventListener(ConnectionEventListener listener)Register a new listener for the connection.Parameters:
listener - the event listener
void close() throws SQLExceptionClose the physical connection. This method is usually called by the connection pool.Throws:
SQLException
void commit(Xid xid, boolean onePhase) throws XAExceptionCommit a transaction.Parameters:
xid - the transaction id
onePhase - use a one-phase protocol if true
Throws:
XAException
void end(Xid xid, int flags) throws XAExceptionEnd a transaction.Parameters:
xid - the transaction id
flags - TMSUCCESS, TMFAIL, or TMSUSPEND
Throws:
XAException
void forget(Xid xid)Forget a transaction. This method does not have an effect for this database.Parameters:
xid - the transaction id
Connection getConnection() throws SQLExceptionGet a new connection. This method is usually called by the connection pool when there are no more connections in the pool.Returns:
the connection
Throws:
SQLException
int getTransactionTimeout()Get the transaction timeout.Returns:
0
XAResource getXAResource()Get the XAResource object.Returns:
itself
boolean isSameRM(XAResource xares)Checks if this is the same XAResource.Parameters:
xares - the other object
Returns:
true if this is the same object
int prepare(Xid xid) throws XAExceptionPrepare a transaction.Parameters:
xid - the transaction id
Throws:
XAException
Xid[] recover(int flag) throws XAExceptionGet the list of prepared transaction branches. This method is called by the transaction manager during recovery.Parameters:
flag - TMSTARTRSCAN, TMENDRSCAN, or TMNOFLAGS. If no other flags are set,
TMNOFLAGS must be used.
Returns:
zero or more Xid objects
Throws:
XAException
void removeConnectionEventListener(ConnectionEventListener listener)Remove the event listener.Parameters:
listener - the event listener
void rollback(Xid xid) throws XAExceptionRoll back a transaction.Parameters:
xid - the transaction id
Throws:
XAException
boolean setTransactionTimeout(int seconds)Set the transaction timeout.Parameters:
seconds - ignored
Returns:
false
void start(Xid xid, int flags) throws XAExceptionStart or continue to work on a transaction.Parameters:
xid - the transaction id
flags - TMNOFLAGS, TMJOIN, or TMRESUME
Throws:
XAException
|