Package com.nuodb.jdbc
Class RemXAResource
- java.lang.Object
-
- com.nuodb.jdbc.RemXAResource
-
- All Implemented Interfaces:
XAResource
public class RemXAResource extends Object implements XAResource
-
-
Field Summary
-
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 RemXAResource(RemXAConnection xaConn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit(Xid xid, boolean onePhase)Commits the global transaction specified by xid.voidend(Xid xid, int flags)Commits the global transaction specified by xid.voidforget(Xid xid)Forget about a transaction branch.intgetTransactionTimeout()Get the current transaction timeout value for this resource.booleanisSameRM(XAResource xares)Tells the caller if this resource has the same resource manager as the argument resource.intprepare(Xid xid)Prepare for a transaction commit of the specified xid.Xid[]recover(int flag)Returns a list of prepared transaction branches.voidrollback(Xid xid)Roll back transaction branch specified by xid.booleansetTransactionTimeout(int seconds)Set the transaction timeout value for this resource.voidstart(Xid xid, int flags)Starts work on a transaction branch specified in xid
-
-
-
Constructor Detail
-
RemXAResource
public RemXAResource(RemXAConnection xaConn)
-
-
Method Detail
-
commit
public void commit(Xid xid, boolean onePhase) throws XAException
Commits the global transaction specified by xid.- Specified by:
commitin interfaceXAResource- Parameters:
xid- - A global transaction identifier.onePhase- - Use a one-phase commit protocol to commit the work done on behalf of xid.- Throws:
XAException
-
forget
public void forget(Xid xid) throws XAException
Forget about a transaction branch.- Specified by:
forgetin interfaceXAResource- Parameters:
xid- - A global transaction identifier used by the start method.- Throws:
XAException
-
end
public void end(Xid xid, int flags) throws XAException
Commits the global transaction specified by xid.- Specified by:
endin interfaceXAResource- Parameters:
xid- - A global transaction identifier used by the start method.flags- - TMSUCCESS, TMFAIL, or TMSUSPEND.- Throws:
XAException
-
getTransactionTimeout
public int getTransactionTimeout() throws XAExceptionGet the current transaction timeout value for this resource.- Specified by:
getTransactionTimeoutin interfaceXAResource- Returns:
- The current timeout value, in seconds.
- Throws:
XAException- If an error occurred.
-
isSameRM
public boolean isSameRM(XAResource xares) throws XAException
Tells the caller if this resource has the same resource manager as the argument resource.- Specified by:
isSameRMin interfaceXAResource- Throws:
XAException- If an error occurred.
-
prepare
public int prepare(Xid xid) throws XAException
Prepare for a transaction commit of the specified xid.- Specified by:
preparein interfaceXAResource- Parameters:
xid- - A global transaction identifier.- Returns:
- - XA_RDONLY or XA_OK.
- Throws:
XAException
-
recover
public Xid[] recover(int flag) throws XAException
Returns a list of prepared transaction branches.- Specified by:
recoverin interfaceXAResource- Parameters:
flag- - TMNOFLAGS- Returns:
- Array of prepared transaction XIDs.
- Throws:
XAException
-
rollback
public void rollback(Xid xid) throws XAException
Roll back transaction branch specified by xid.- Specified by:
rollbackin interfaceXAResource- Parameters:
xid- - A global transaction identifier.- Throws:
XAException
-
start
public void start(Xid xid, int flags) throws XAException
Starts work on a transaction branch specified in xid- Specified by:
startin interfaceXAResource- Parameters:
xid- - A global transaction identifier.flags- - TMJOIN, TMSUSPEND, or TMNOFLAGS.- Throws:
XAException
-
setTransactionTimeout
public boolean setTransactionTimeout(int seconds) throws XAExceptionSet the transaction timeout value for this resource. NuoDB resource manager does not support setting the timeout value.- Specified by:
setTransactionTimeoutin interfaceXAResource- Parameters:
seconds- The timeout value, in seconds.- Returns:
- false
- Throws:
XAException
-
-