The ax_reg( ) function 3registers an XA data source with the current transaction. This function 3must be repeated with each new transaction.
3Use the following syntax for an ax_reg( ) function:
3int 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
3You 3can use the mi_xa_get_xadatasource_rmid( ) function 3to enable the DataBlade module to get the ID the correct rmid value.
3 3The resource manager ID must be present in a row in the sysxadatasources system 3catalog table that was created with the CREATE XADATASOURCE statement 3of SQL.
Dynamic Server can operate as a resource manager in a global 3transaction managed by a third party transaction manager. The ax_reg( ) function 3should not be used if Dynamic Server is operating as a resource 3manager.
Multiple registrations of the same XA data source in a single 3transaction do not effect either the transaction or the XA data 3source.
3For more information on this function, see the IBM Informix: DataBlade API Function Reference.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]