The mi_xa_unregister_xadatasource() function
The mi_xa_unregister_xadatasource() function unregisters the previously registered XA data source from the transaction.
Use the following syntax for an mi_xa_unregister_xadatasource() function:
mi_integer mi_xa_unregister_xadatasource(mi_string *xasrc)
For example:
#include "xa.h"
#include "milib.h"
int retcode;
retcode = mi_xa_unregister_xadatasource("informix.Newyork"));
if ( retcode != MI_OK)
{
/* Error while unregistering the XA data source */
}
/* Successfully unregistered */
When you use the mi_xa_unregister_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.
You can use the mi_xa_get_current_xid() function to return the pointer to the current XID structure for an XA-compliant, external data source.
- Only call the mi_xa_unregister_xadatasource() function within an explicit or implicit transaction.
- Do not call the mi_xa_unregister_xadatasource() function:
- From the subordinator of a distributed transaction.
- From within a resource manager global transaction.
- In a nonlogging database.
- From any of the XA purpose functions that are specified in a CREATE XADATASOURCE TYPE statement.
- Do not unregister an XA data source that is not registered or already unregistered.
For more information about this function, see the Informix® DataBlade® API Function Reference.