The mi_xa_get_xadatasource_rmid() function

The mi_xa_get_xadatasource_rmid() function gets the resource manager ID that was previously created in the database for an XA-compliant, external data source.

Syntax

mi_integer mi_xa_get_xadatasource_rmid(mi_string *xasrc)
xasrc
The user-defined name of the XA data source.
Valid in client LIBMI application? Valid in user-defined routine?
No Yes

Usage

The mi_xa_get_xadatasource_rmid() function can be used while invoking the ax_reg() or the ax_unreg() function in subsequent calls. If successful, this function returns the resource manger ID.

The format of the xasrc name is [owner].xadatasourcename. If the owner is specified, the mi_xa_get_xadatasource_rmid() function searches for the owner and the data source name. If the owner is not specified, the function:
  • Searches for the XA data source name in a non-ANSI database.
  • Adds the current user to the XA data source name when searching an ANSI database.
If you receive an error, check for any of the following problems:
  1. Make sure the value for xasrc is correct.
  2. Make sure that the mi_xa_get_xadatasource_rmid() function is not called:
    • From the sub-ordinator of a distributed transaction.
    • In a non-logging database
  3. Make sure that the xasrc XA data source is created in the database.

For more information about working with XA data sources, see the Informix® DataBlade® API Programmer's Guide.

Return values

> 0
The resource manager ID.
MI_ERROR
An error occurred while getting the resource manager ID.
MI_NOSUCH_XASOURCE
The XA data source does not exist in the system.
MI_INVALID_XANAME
The user-defined name (owner.xadatasourcename) for an instance of XA data source is not valid.