The xa_commit() function

The xa_commit() function requests each participating XA data source to commit a transaction. If all of the XA data sources return TMSUCCESS on calls to xa_end() and to xa_prepare(), the database server calls xa_commit() on each participating XA data source.

The syntax for the function is:
mint xa_commit (XID *xid,   /* IN */
           mint rmid,     /* IN */
          int4 flags)    /* IN */
Table 1. The xa_commit() parameters
Parameter Description
xid Pointer to the XID data structure that is defined in the xa.h file and used for the current transaction
rmid Unique resource manager identifier
flags TMNOFLAGS, which is the valid value.
The following code sample contains the xa_commit() function:
#include "xa.h"
mint mqseries_commit(XID *xid, mint rmid, int4 flags)
  {
/*  Error  */
   return XAER_RMERR;
/* Success */
  return XA_OK;
}

For valid return values, refer to X/Open information, including Distributed Transaction Processing: The XA Specification.