The xa_close() function

When the database is closed or the session ends, which ever occurs first, HCL Informix® calls the xa_close() function for each XA data source used in the database session. This occurs when a new local database is opened, a database is closed, or a client session ends. The xa_close() function is also called when the XA data source is created and registered in a transaction and the transaction is rolled back.

When a database session is closed, all of the XA resources are freed and HCL Informix calls xa_close() for any registered XA datasources in the database session.

The syntax for the function is
mint xa_close(char *xa_info, /* IN */
           mint rmid,     /* IN */
           int4 flags)   /* IN */
Table 1. The xa_close() parameters
Parameter Description
xa_info Information string ("session-id:databasename@servername")
rmid Unique resource manager identifier
flags TMNOFLAGS, the valid value
The following code fragment contains the xa_close() function:
#include "xa.h"
mint mqseries_close(char *xa_info, 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.