Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
DB XA Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

5.4 Informix Access Module

Using the DB XA Module with the Informix Access Module provides XA functionality through the ODBC API.


NOTE -- Only Informix SDK 2.70 and above provide XA functionality through the ODBC API.

This section describes how to use the Informix Access Module with XA functionality. This chapter assumes that you have followed the instructions for installing and building the DB XA Module with Informix. These instructions are located in Appendix A, "Installing and Building the DB XA Module," of the manual Installing and Building Your SourcePro C++ Products.

5.4.1 Configuring the Resource Manager

As explained in Chapter 4, XA connections to your database are established by using the database() function in RWDBManager, and providing its connectString parameter with key XA=xaParameter. This section explains how you obtain the Informix-specific value of the xaParameter argument.

When you run on Informix, the value of the xaParameter argument must be the same as that used for the Application Number parameter in the open string passed to the TPM to open the database. The open string for the Informix database takes the following form:


NOTE -- Consult your Informix and TPM documentation for complete and up-to-date information.

The parameters for the Informix open string include:

5.4.2 Switch Table

The XA interface describes a structure called the switch table, which lists the names of the xa_ routines implemented in the resource manager. This structure is called xa_switch_t, and is defined in the xa.h header file. The switch table helps build servers that are truly independent of the database vendor being used.

In order to be integrated in the X/Open environment, each resource manager must define the name of its XA switch table. The Informix ODBC-specific xa_switch_t table is accessible through the variable _Odbc_xa_switch. You can use the following DB XA method to access the switch table in a database-independent manner:

For static libraries, you must supply the string "INFORMIX" to the xaSwitch() function.

For shared libraries, you must supply the name of the access library, using the same name as the non-XA library. For example:

Note that the method RWDBManager::xaSwitch(const RWCString&) returns a void*. This return value must be cast to a struct xa_switch_t pointer.

5.4.3 Databases and Connections

The DB XA Module does not open connections to a database server. Instead, it makes use of connections previously opened by the transaction processing monitor (TPM). Therefore, the DB XA Module does not make use of any Informix calls that explicitly establish connections to database servers.

The DB XA Module uses following API provided by Informix:

5.4.3.1 RWDBDatabase Objects

In order for the DB XA Module to interact with a resource manager and establish connectivity, you must create an instance of RWDBDatabase by calling:

All arguments are of type RWCString. Note that establishing an XA connection to the Informix database requires only two of the six database() arguments, as described here:

5.4.4 RWDBSystemHandle and RWDBEnvironmentHandle

The DB XA Module does not differ from the DB Interface Module in its approach to using RWDBSystemHandle and RWDBEnvironmentHandle with the Informix Access Module. See the Informix Access Module User's Guide for information about the Informix-specific implementations of these classes.



Previous fileTop of DocumentContentsIndex pageNext file

©2005 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.