Home | Previous Page | Next Page   Database Access > Working with XA-Compliant External Data Sources > Registering and Unregistering XA-Compliant Data Sources > 3 3 3

Using ax_reg( )

3

The ax_reg( ) function 3registers an XA data source with the current transaction. This function 3must be repeated with each new transaction.

3

Use the following syntax for an ax_reg( ) function:

3
int ax_reg(int rmid, XID *xid, int4 flags)
3

For example:

3

3
    #include "xa.h"
3     #include "milib.h"
3     int   rmid, retcode;
3    XID  *xid;
3   if ( (rmid = mi_xa_get_xadatasource_rmid("informix.Newyork")) <= 0)
3       {
3        /* Error while getting XA data source id */
3       }
3    if ( !(xid = (XID *)mi_alloc(sizeof(XID)) ))
3          {
3        /* Memory allocation error */
3          }
3  retcode  = ax_reg(rmid, xid, TMNOFLAGS);
3if (retcode != TM_OK )
3     {
3         /* ax_reg() Error  */
3     }
3 /* ax_reg() is Successful */
3

When you use the ax_reg( ) function, follow 3these guidelines: 3

3 3

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

3

For more information on this function, see the IBM Informix: DataBlade API Function Reference.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]