Home | Previous Page | Next Page   Database Access > Working with XA-Compliant External Data Sources > Creating User-Defined XA-Support Routines > 3 3 3

The xa_open( ) function

3

The xa_open( ) function 3is called once per database session for each XA data source that 3participates in a Dynamic Server transaction. The xa_open( ) function 3is called when a user-defined function registers the XA data source 3with a transaction by calling mi_ register_xadatasource( ) or 3using ax_reg( ) for the first time after the database 3opens.

3

Subsequent calls to mi_register_xadatasource( ) or ax_reg( ) in 3the same the same database session do not result in the invocation 3of the xa_open( ) function.

3

The syntax for the function is: 3

3
 mint xa_open(char *xa_info, /* IN */
3            mint rmid,     /* IN */
3            int4 flags)   /* IN */
3

3 33333333333333333333333
Table 73. xa_open( ) Parameters
Parameter Description
xa_info Information string ("session-id:databasename@servername")
rmid Unique resource manager identifier
flags TMNOFLAGS, the valid value
3

The following code fragment contains the xa_open( ) function: 3

3
#include "xa.h"
3mint mqseries_open(char *xa_info, mint rmid, int4 flags)
3  {
3/* setup the datastructures/etc.  */
3if ( (myloc = mi_dalloc(sizeof(struct my_location), PER_SESSION))
3     == (char *) NULL)
3    {
3    return XAER_RMERR;
3    }
3....
3Return XA_OK;
3  }
3

For valid return values, refer to X/Open information, including Distributed Transaction Processing: The XA Specification.

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