public class XAResourceImpl extends Object implements XAResource
XAResource
wrapper for Generic JDBC Connector.TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
Constructor and Description |
---|
XAResourceImpl(XAResource xar,
ManagedConnectionImpl mc)
Constructor for XAResourceImpl
|
Modifier and Type | Method and Description |
---|---|
void |
commit(Xid xid,
boolean onePhase)
Commit the global transaction specified by xid.
|
void |
end(Xid xid,
int flags)
Ends the work performed on behalf of a transaction branch.
|
void |
forget(Xid xid)
Tell the resource manager to forget about a heuristically completed transaction branch.
|
int |
getTransactionTimeout()
Obtain the current transaction timeout value set for this
XAResource instance. |
boolean |
isSameRM(XAResource xares)
This method is called to determine if the resource manager instance
represented by the target object is the same as the resouce manager
instance represented by the parameter xares.
|
int |
prepare(Xid xid)
Ask the resource manager to prepare for a transaction commit
of the transaction specified in xid.
|
Xid[] |
recover(int flag)
Obtain a list of prepared transaction branches from a resource manager.
|
void |
rollback(Xid xid)
Inform the resource manager to roll back work done on behalf of a transaction branch
|
boolean |
setTransactionTimeout(int seconds)
Set the current transaction timeout value for this
XAResource instance. |
void |
start(Xid xid,
int flags)
Start work on behalf of a transaction branch specified in xid.
|
public XAResourceImpl(XAResource xar, ManagedConnectionImpl mc)
xar
- XAResource
mc
- ManagedConnection
public void commit(Xid xid, boolean onePhase) throws XAException
commit
in interface XAResource
xid
- A global transaction identifieronePhase
- If true, the resource manager should use a one-phase commit
protocol to commit the work done on behalf of xid.XAException
public void end(Xid xid, int flags) throws XAException
end
in interface XAResource
xid
- A global transaction identifier that is the same as what
was used previously in the start method.flags
- One of TMSUCCESS, TMFAIL, or TMSUSPENDXAException
public void forget(Xid xid) throws XAException
forget
in interface XAResource
xid
- A global transaction identifierXAException
public int getTransactionTimeout() throws XAException
XAResource
instance.getTransactionTimeout
in interface XAResource
XAException
public boolean isSameRM(XAResource xares) throws XAException
isSameRM
in interface XAResource
xares
- An XAResource
object whose resource manager
instance is to be compared with the resourceXAException
public int prepare(Xid xid) throws XAException
prepare
in interface XAResource
xid
- A global transaction identifierXAException
in the prepare method.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 flags.XAException
.XAException
public void rollback(Xid xid) throws XAException
rollback
in interface XAResource
xid
- A global transaction identifierXAException
public boolean setTransactionTimeout(int seconds) throws XAException
XAResource
instance.setTransactionTimeout
in interface XAResource
seconds
- the transaction timeout value in seconds.XAException
public void start(Xid xid, int flags) throws XAException
start
in interface XAResource
xid
- A global transaction identifier to be associated with the resourceflags
- One of XAResource.TMNOFLAGS
, XAResource.TMJOIN
, or XAResource.TMRESUME
XAException
Copyright © 2020. All rights reserved.