xa_commit()--Commit an XA Transaction Branch (Transaction Scoped Locks


  Syntax
 #include <xa.h>

 int xa_switch.xa_commit_entry(XID *xid,       

     int rmid, long flags);

  Default Public Authority: *USE

  Service Program: QTNXADTP

  Threadsafe: Yes

A transaction manager calls xa_commit() to commit the work associated with *xid. All changes that were made to resources managed by DB2® for IBM® i during the transaction branch are made permanent.


Parameters

xid
(Input) A pointer to the transaction branch identifier. This identifier was generated by the transaction manager when the transaction branch was started.

rmid
(Input) An integer value that the transaction manager generated when calling xa_open(). The rmid identifies the resource manager.

flags
(Input) Following are the valid settings of flags.

TMNOWAIT: 0x10000000L Do not commit the transaction if a blocking condition exists.

TMONEPHASE: 0x40000000L Use the one-phase commit optimization for the specified transaction branch.

TMNOFLAGS: 0x00000000L Use if no other flags are set.


Authorities

None


Return Value

The following values may be returned only if TMONEPHASE(0x40000000L) was set in the flags parameter.


The following values may be returned for all flags settings.


Error Messages

The following messages may be sent from this function.


Related Information


Example

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

#include <xa.h>

main() {
  XID  *xid;
  int  rmid;
  long flags;
  int  retcode;
  extern struct xa_switch_t xa_switch;

  retcode =
     xa_switch.xa_commit_entry(xid, rmid, flags);
}


API introduced: V5R2

[ Back to top | UNIX-Type APIs | APIs by category ]