IBM Books

Administration Guide


XA Function Supported

The common server versions of DB2 support the XA91 specification defined in X/Open CAE Specification Distributed Transaction Processing: The XA Specification manual, with the following exceptions:

XA Switch Usage

As required by the XA interface, the database manager provides a db2xa_switch external C variable of type xa_switch_t to return the XA switch structure to the TM. Other than the addresses of the various XA functions, the following fields are returned:

Field
Value

name
The product name of the database manager: for example, DB2 for AIX

flags
TMREGISTER || TMNOMIGRATE Explicitly states that the TM should not use association migration or asynchronous operation. Also implicitly states that dynamic registration is used by this RM.

version
Must be zero.

XA Open and Close Strings Usage

The database manager open string has the following syntax:

  "database_alias<,username,password>"

The database_alias is required to specify the database alias name of the database. This alias name is the same as the database name unless you have explicitly cataloged an alias name after you created the database. The username and password are optional, and are used to provide authentication information to the database if the database is set up with authentication=SERVER.

The database manager does not use the XA close string and its content will be ignored.

DB2 for Windows NT supports the X/Open XA Interface. However the interface to the db2xa_switch data structure is different for DB2 for Windows NT due to operating system differences.

The pointer to the xa_switch structure, db2xa_switch, is exported as DLL data. This implies that a Windows NT application using this structure must reference it in one of two ways:

DB2 for Windows NT also provides an API, db2xacic, which returns the address of the db2xa_switch structure. This function is prototyped as:

   struct xa_switch_t * SQL_API_FN  db2xacic( )

The following code illustrates the different ways the db2xa_switch can be accessed via a C program:

#include <stdio.h>
#include <xa.h>
 
struct xa_switch_t * SQL_API_FN  db2xacic( );
 
#ifdef DECLSPEC_DEFN
extern __declspec(dllimport) struct xa_switch_t db2xa_switch;
#else
#define db2xa_switch (*db2xa_switch)
extern struct xa_switch_t db2xa_switch;
#endif
 
main( )
{
   struct xa_switch_t *foo;
   printf ("%s \n", db2xa_switch.name );
   foo = db2xacic();
   printf ( "%s \n", foo->name );
   return ;
}

Making the Transacation Manager Known to the Resource Manager

DB2 needs to resolve the entry points to ax_reg and ax_unreg with the TM in order to be able to dynamically register a transaction:


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

[ DB2 List of Books | Search the DB2 Books ]