The mi_xa_register_xadatasource() function

The mi_xa_register_xadatasource() function registers an XA data source with the current transaction. This function must be repeated with each new transaction. This function operates the same way as the ax_reg() function.

Use the following syntax for an mi_xa_register_xadatasource() function
mi_integer mi_xa_register_xadatasource(mi_string *xasrc)
For example:
     #include "xa.h"
     #include "milib.h"
     int    retcode;
   retcode = mi_xa_register_xadatasource("informix.Newyork"));
  if ( retcode != MI_OK)
       {
        /* Error while registering the XA data source   */
       }
            /* Success fully registered */
When you use the mi_xa_register_xadatasource() function, follow these guidelines:
  • Get the correct value for xarsc, which is the user-defined name of the XA data source. The format of the xarsc name is owner.xadatasourcename.
  • Only call the mi_xa_register_xadatasource() function within an explicit or implicit transaction.
  • Do not call the mi_xa_register_xadatasource() function:
    • From the subordinator of a distributed transaction or from within a resource manager global transaction.

      HCL Informix® can operate as a resource manager in a global transaction managed by a third party transaction manager. The mi_xa_register_xadatasource() function must not be used if HCL Informix is operating as a resource manager.

    • In a nonlogging database
    • From any of the XA purpose functions that are specified in a CREATE XADATASOURCE TYPE statement.

Multiple registrations of the same XA data source in a single transaction do not effect either the transaction or the XA data source.

For more information about this function, see the Informix DataBlade® API Function Reference.