This class provides support for distributed transactions.
An application developer usually does not use this interface.
It is used by the transaction manager internally.
Methods |
void |
addConnectionEventListener(ConnectionEventListener listener)
Register a new listener for the connection.
|
void |
addConnectionEventListener(ConnectionEventListener listener)
Register a new listener for the connection.
Parameters:
listener - the event listener
|
void |
addStatementEventListener(StatementEventListener listener)
[Not supported] Add a statement event listener.
|
void |
addStatementEventListener(StatementEventListener listener)
[Not supported] Add a statement event listener.
Parameters:
listener - the new statement event listener
|
void |
close()
Close the physical connection.
|
void |
close() throws SQLException
Close the physical connection.
This method is usually called by the connection pool.
|
void |
commit(Xid xid, boolean onePhase)
Commit a transaction.
|
void |
commit(Xid xid, boolean onePhase) throws XAException
Commit a transaction.
Parameters:
xid - the transaction id
onePhase - use a one-phase protocol if true
|
void |
end(Xid xid, int flags)
End a transaction.
|
void |
end(Xid xid, int flags) throws XAException
End a transaction.
Parameters:
xid - the transaction id
flags - TMSUCCESS, TMFAIL, or TMSUSPEND
|
void |
forget(Xid xid)
Forget a transaction.
|
void |
forget(Xid xid)
Forget a transaction.
This method does not have an effect for this database.
Parameters:
xid - the transaction id
|
Connection |
getConnection()
Get a connection that is a handle to the physical connection.
|
Connection |
getConnection() throws SQLException
Get a connection that is a handle to the physical connection. This method
is usually called by the connection pool. This method closes the last
connection handle if one exists.
Returns:
the connection
|
int |
getTransactionTimeout()
Get the transaction timeout.
|
int |
getTransactionTimeout()
Get the transaction timeout.
Returns:
0
|
XAResource |
getXAResource()
Get the XAResource object.
|
XAResource |
getXAResource()
Get the XAResource object.
Returns:
itself
|
boolean |
isSameRM(XAResource xares)
Checks if this is the same XAResource.
|
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)
Prepare a transaction.
|
int |
prepare(Xid xid) throws XAException
Prepare a transaction.
Parameters:
xid - the transaction id
Returns:
XA_OK
|
Xid[] |
recover(int flag)
Get the list of prepared transaction branches.
|
Xid[] |
recover(int flag) throws XAException
Get 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
|
void |
removeConnectionEventListener(ConnectionEventListener listener)
Remove the event listener.
|
void |
removeConnectionEventListener(ConnectionEventListener listener)
Remove the event listener.
Parameters:
listener - the event listener
|
void |
removeStatementEventListener(StatementEventListener listener)
[Not supported] Remove a statement event listener.
|
void |
removeStatementEventListener(StatementEventListener listener)
[Not supported] Remove a statement event listener.
Parameters:
listener - the statement event listener
|
void |
rollback(Xid xid)
Roll back a transaction.
|
void |
rollback(Xid xid) throws XAException
Roll back a transaction.
Parameters:
xid - the transaction id
|
boolean |
setTransactionTimeout(int seconds)
Set the transaction timeout.
|
boolean |
setTransactionTimeout(int seconds)
Set the transaction timeout.
Parameters:
seconds - ignored
Returns:
false
|
void |
start(Xid xid, int flags)
Start or continue to work on a transaction.
|
void |
start(Xid xid, int flags) throws XAException
Start or continue to work on a transaction.
Parameters:
xid - the transaction id
flags - TMNOFLAGS, TMJOIN, or TMRESUME
|