|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.access.AS400JDBCXAResource
The AS400JDBCXAResource class represents a resource manager for use in XA transaction management.
This support is only available when connecting to servers running OS/400 V5R1 or later.
The following example creates an AS400JDBCXAResource object that can be used to work with the XA resource manager.
// Create an XA data source for making the XA connection. AS400JDBCXADataSource xaDataSource = new AS400JDBCXADataSource("myAS400"); xaDataSource.setUser("myUser"); xaDataSource.setPassword("myPasswd"); // Get an XAConnection and get the associated XAResource. // This provides access to the resource manager. XAConnection xaConnection = xaDataSource.getXAConnection(); XAResource xaResource = xaConnection.getXAResource(); // ... work with the XA resource. // Close the XA connection when done. This implicitly // closes the XA resource. xaConnection.close();
AS400JDBCXAConnection
,
AS400JDBCXADataSource
Fields inherited from interface javax.transaction.xa.XAResource |
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
Method Summary | |
void |
commit(javax.transaction.xa.Xid xid,
boolean onePhase)
Commits a global transaction. |
void |
end(javax.transaction.xa.Xid xid,
int flags)
Ends the work performed on behalf of a transaction branch. |
void |
forget(javax.transaction.xa.Xid xid)
Tells the resource manager to forget about a heuristically completed transaction branch. |
int |
getTransactionTimeout()
Returns the current transaction timeout value. |
boolean |
isSameRM(javax.transaction.xa.XAResource xaResource)
Indicates if the resource manager represented by this XA resource is the same resource manager represented by the specified XA resource. |
int |
prepare(javax.transaction.xa.Xid xid)
Prepares for a transaction commit. |
javax.transaction.xa.Xid[] |
recover(int flags)
Recovers a list of prepared transaction branches from the resource manager. |
void |
rollback(javax.transaction.xa.Xid xid)
Rolls back a transaction branch. |
boolean |
setTransactionTimeout(int transactionTimeout)
Sets the current transaction timeout value. |
void |
start(javax.transaction.xa.Xid xid,
int flags)
Starts the work on behalf of a transaction branch. |
java.lang.String |
toString()
Returns the string representation of the XA resource. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public void commit(javax.transaction.xa.Xid xid, boolean onePhase) throws javax.transaction.xa.XAException
commit
in interface javax.transaction.xa.XAResource
xid
- The global transaction identifier.onePhase
- true if the resource manager should use a one-phase
commit protocol to commit the work; false otherwise.javax.transaction.xa.XAException
- If an error occurs.public void end(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
end
in interface javax.transaction.xa.XAResource
xid
- The global transaction identifier. This must correspond
to the global transaction identifier previously passed
to start().flags
- The flags. Possible values are:
javax.transaction.xa.XAException
- If an error occurs.public void forget(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
forget
in interface javax.transaction.xa.XAResource
xid
- The global transaction identifier.javax.transaction.xa.XAException
- If an error occurs.public int getTransactionTimeout() throws javax.transaction.xa.XAException
getTransactionTimeout
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
- If an error occurs.public boolean isSameRM(javax.transaction.xa.XAResource xaResource) throws javax.transaction.xa.XAException
isSameRM
in interface javax.transaction.xa.XAResource
xaResource
- The XA resource.javax.transaction.xa.XAException
- If an error occurs.public int prepare(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
prepare
in interface javax.transaction.xa.XAResource
xid
- The global transaction identifier.javax.transaction.xa.XAException
- If an error occurs.public javax.transaction.xa.Xid[] recover(int flags) throws javax.transaction.xa.XAException
recover
in interface javax.transaction.xa.XAResource
flags
- The flags. Possible values are:
javax.transaction.xa.XAException
- If an error occurs.public void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
rollback
in interface javax.transaction.xa.XAResource
xid
- The global transaction identifier.javax.transaction.xa.XAException
- If an error occurs.public boolean setTransactionTimeout(int transactionTimeout) throws javax.transaction.xa.XAException
setTransactionTimeout
in interface javax.transaction.xa.XAResource
transactionTimeout
- The current transaction timeout value in seconds,
or 0 to reset the timeout value to the default.javax.transaction.xa.XAException
- If an error occurs.public void start(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
start
in interface javax.transaction.xa.XAResource
xid
- The global transaction identifier.flags
- The flags. Possible values are:
javax.transaction.xa.XAException
- If an error occurs.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |