public class AGXAResource extends Object implements XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
Constructor and Description |
---|
AGXAResource(AGRepositoryConnection conn) |
Modifier and Type | Method and Description |
---|---|
void |
commit(Xid xid,
boolean onePhase) |
void |
end(Xid xid,
int flags)
Disassociate the transaction (identified by xid) from the resource
Ends the work performed on behalf of a transaction branch.
|
void |
forget(Xid xid) |
int |
getTransactionTimeout() |
boolean |
isSameRM(XAResource xares)
This method must return true if xares and 'this' correspond to the same repository,
regardless of how the connection is made or who is accessing.
|
int |
prepare(Xid xid)
Ask the resource manager to prepare for a transaction commit of the
transaction specified in xid.
|
Xid[] |
recover(int flag)
Obtains a list of prepared transaction branches from a resource manager.
|
void |
rollback(Xid xid) |
boolean |
setTransactionTimeout(int seconds) |
void |
start(Xid xid,
int flags)
Starts work on behalf of a transaction branch specified in xid.
|
public AGXAResource(AGRepositoryConnection conn)
public void start(Xid xid, int flags) throws XAException
start
in interface XAResource
xid
- A global transaction identifier to be associated with the resource.flags
- One of TMNOFLAGS, TMJOIN, or TMRESUME.XAException
public void end(Xid xid, int flags) throws XAException
end
in interface XAResource
xid
- A global transaction identifier that is the same as the identifier
used previously in the start method.flags
- One of TMSUCCESS, TMFAIL, or TMSUSPEND.XAException
public void rollback(Xid xid) throws XAException
rollback
in interface XAResource
XAException
public int prepare(Xid xid) throws XAException
prepare
in interface XAResource
xid
- The global transaction identifier to assign to the prepared commit.XAException
- An error has occurred. Possible exception values
are: XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or
XAER_PROTO.public void commit(Xid xid, boolean onePhase) throws XAException
commit
in interface XAResource
XAException
public void forget(Xid xid) throws XAException
forget
in interface XAResource
XAException
public boolean isSameRM(XAResource xares) throws XAException
isSameRM
in interface XAResource
xares
- The XAResource to compare with.XAException
public Xid[] recover(int flag) throws XAException
recover
in interface XAResource
flag
- One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS.
TMNOFLAGS must be used when no other flags are set
in the parameter.XAException
- An error has occurred. Possible values are XAER_RMERR,
XAER_RMFAIL, XAER_INVAL, and XAER_PROTO.public int getTransactionTimeout() throws XAException
getTransactionTimeout
in interface XAResource
XAException
public boolean setTransactionTimeout(int seconds) throws XAException
setTransactionTimeout
in interface XAResource
XAException
Copyright © 2020 Franz Inc.. All rights reserved.