White Paper Series: #5
Author: Stephen P. Clark

About Aurora Information Systems, Inc. How to Contact Aurora Information Systems, Inc.
 

Informix XA Configuration for Tuxedo System/T on the Windows NT Platform

Download this White Sheet in PDF format. Right click your mouse and select SAVE TARGET AS or SAVE LINK AS.

Introduction

A common program model incorporated into business applications is the processing of transactions requiring multiple operations using several servers with one or more resource management interfaces.

This methodology of performing a transaction over groups of processes is known as Distributed Transaction Processing or DTP. The completion of the set of operations is known as a logical "unit of work." Each logical "unit of work" completed over the multiple processes is known as a global transaction.

A powerful feature of the Tuxedo System/T solution is the capacity to implement the X/Open Distributed Transaction Processing model into the application. The Informix relational database management system is a resource manager that may be incorporated for such a model because the product adheres to the X/Open standards for DTP XA compliance.

To implement XA in the Tuxedo System/T solution, employing the Informix RDBMS resource manager for DTP on the Windows NT platform, the following tasks must be completed:

  • A transaction management program must be created to perform the transaction management functions of the Informix XA resource.
  • The UBBCONFIG file must be configured to utilize the Informix XA resource.
  • The Informix Setnet32.exe utility must be configured for the database servers utilizing the Informix XA resource to access the database.
  • Servers must be developed to adhere to the corresponding programming constraints for the X/Open DTP environment.

Return to Top of Page

Building the Tuxedo System/T Transaction Management Program for the Informix XA Resource

The X/Open distributed transaction processing model implements a scheme as follows:

  • The application informs the transaction management processes that a transaction is going to begin.
  • The application performs operations on one or more resources. The transaction management processes are informed to commit or abort the transaction.

Example Distributed Transaction Processing Model
Figure 1. Example Distributed Transaction Processing Model.

The transaction manager server (TMS) must be built in order to use Informix for X/Open DTP in the Tuxedo application. The server must be entered for the transaction manager server name parameter, TMSNAME, in the UBBCONFIG file, explained in the next section.

Buildtms -r ‹resource name identifier› -o ‹transaction management server name›

The resource name identifier is the entry found in the %TUXDIR%\udataobj\rm file, entered as INFORMIX-OnLine. The transaction management server name is the executable binary to be created. However, the build of the transaction management server can not be successfully completed without the modifying the resource entry provided by Tuxedo.

  • The Informix XA resource entry in the %TUXDIR%\udataobj\rm file is not WinNT compatible. Each entry in the file determines the "resource entry" followed by the link function and then the library to link to transaction management program. The line appears in a UNIX style format as follows:

    Informix-OnLine:infx_xa_switch:${InformixDIR}/lib/esql/libinfxxa.a -lx


    For the WinNT format, the entry must be delimited by semicolons instead of colons in order for the buildtms.exe utility to recognize the entry the RM file. Also the entry must incorporate the corresponding WinNT library, shown as follows:

    Informix-OnLine;(*fx_xa_switch());{InformixDIR}/lib/isqlt09a.lib
  • Build the transaction management server,TMS_Informix.exe by invoking the command as follows:

    Buildtms r Informix-OnLine o TMS_Informix.exe
  • Place the program in the %TUXDIR%\bin binary executables directory. The transaction management program is now ready to be used in the Tuxedo system.

Return to Top of Page

Configuration of the UBBCONFIG file for INFORMIX XA

The UBBCONFIG file must be configured appropriately for utilizing the Informix XA resource. A server group must be declared in the *GROUPS section similar to the following:

*GROUPS
"INFX_RM_GRP"
	LMID="machine1"  GRPNO=8
	OPENINFO="Informix-OnLine:db_name"
	TMSNAME="TMS_Informix"
	TMSCOUNT=3
	

The OPENINFO string must consist of the Informix resource entry in the
%TUXDIR%\udataobj\rm file, followed by the name of the database instance where the servers must perform the database operations. The resource entry name and the database instance name must be delimited by a colon. The username and password are not included in the OPENINFO string, as commonly found when implementing other resource managers, because Informix does not yet support this feature at this time.

The transaction management server, built as described in the prior section, must be entered for the TMSNAME parameter.

After configuring the *GROUPS section, enter the servers using the Informix XA resource manager in the *SERVERS section with the SRVGRP parameter set to the corresponding group name. No further Informix XA specific configuration is necessary in the UBBCONFIG file.

Return to Top of Page

Configuring the Setnet32 Utility

The Informix resource manager obtains most of the database connection parameters from the Setnet32 utility configuration. The utility is provided with the Informix XA installation.

Return to Top of Page

Environment Information Settings

In the Environment window set the following variables:

INFORMIXDIR Set to the directory where the Informix client utilities to connect to the relational database system was installed on the client workstation
INFORMIXSERVER Set to the name of the database server located on the host machine

An example of the Environment window settings is shown as follows:

Environment window settings
Figure 2. Example Environment Variable Settings Window.

Return to Top of Page

Server Information Settings

In the Server Information window set the parameters as follows:

Informix Server Database server located on the host machine
HostName Name of the host machine with the Informix database server
Protocolname Protocol determined by the configuration on the host machine
Service Name Service determined by the host configuration to communicate to the designated database instance

An example window is shown as follows:

Example Server Information Settings Window.
Figure 3. Example Server Information Settings Window.

Return to Top of Page

Host Information Settings

In the Host Information window set the parameters as follows:

Current Host Name of the host machine for the Informix database instance
User Name User name to log on to the host machine/database instance.
Password Option Set to the selection Password from the drop down listing.
Password Password of the user to log onto the host machine/database instance.

An example Host Information Window is shown as follows:

Example Host Information Settings Window.
Figure 4. Example Host Information Settings Window.

Return to Top of Page

Programming Limitations for Servers Using the Informix XA Resource

A general flow for a transaction in an X/Open DTP environment involves a Tuxedo System/T client initiating to begin the transaction, initiating request(s) to server(s) to perform database operations and then finally ending the transaction.

The servers participating must adhere to a number of programming constraints when operating within the X/Open DTP scheme. Also, some database operations behave differently when participating in a global transaction as opposed to performing work in a local transaction. Tuxedo enables work to be performed outside of a global transactions by permitting operations to be completed with the TPNOTRAN option. The programming constraints for the X/Open DTP XA scheme are listed as follows:

Limitation with Database Cursors:
Cursors must be declared, opened and closed within a single service.

Limitation with Temporary Tables:
Temporary tables must be created and used within a single service.

Limitation with Record Locking:
When using locking, each transaction branch is implemented by Informix as a separate transaction. Consequently no two transaction branches may share locks, even if the transaction branches belong to the same global transaction.

Limitations with SQL Statements:
Certain SQL Statements behave differently when participating in a X/Open DTP environment instead of a non-X/Open DTP environment. These differences are listed as follows:

SQL Command Behavior within an X/Open DTP XA Environment
CLOSE DATABASE Error condition, not permitted
CONNECT Error condition, must use the tpopen function when establishing contact with the database
CREATE DATABASE Error condition, not permitted
DATABASE Error condition, not permitted
DISCONNECT Error condition, not permitted
BEGIN WORK Executes in a local transaction, but when invoked during a global transaction an error condition arises and is not permitted.
COMMIT WORK Executes in a local transaction but when invoked during a global transaction an error condition arises and is not permitted.
ROLLBACK WORK Executes in a local transaction, but when invoked during a global transaction, an error condition arises and is not permitted.
LOCK TABLE Lock remains in place until the work within the transaction branch is completed
SET CONNECTION Error condition, not permitted
SET ISOLATION Isolation level is inherited by the server. If changed within a service, the level remains with the new setting until work within the transaction branch is completed.
SET EXPLAIN SET EXPLAIN mode is off by default. After SET EXPLAIN ON command is invoked, all query access procedures are logged to the file sqlexplain.out. The mode remains in effect until the service reaches completion and relinquishes control the next process or a SET EXPLAIN OFF command is invoked.

In a local transaction the file sqlexplain.out is stored in the home directory of the process owner, but in a global transaction, maintained in the directory of the machine where the server is running.

SET LOCK MODE Lock mode and time-out threshhold are inherited by the service. When lock mode is changed within the service, the new mode remains in effect until the service call reaches completion and passes control to the next process, or until modified a subsequent time. Invoking the command will take effect only if the time-out period is less than the period specified by the Transaction Manager. In a local transaction, the command takes effect when invoked.
SET LOG Error condition, not permitted. Unbuffered logging is required. Databases should not be created with buffered logging since they will automatically change database status to unbuffered.
UNLOCK TABLE If issued within any transaction branch, an error condition arises.

Return to Top of Page

Conclusion

The implementation of the X/Open DTP XA scheme for Informix RDBMS resource discussed in the prior sections involved the following:

  • Creating a transaction manager program to perform the transaction management functions of the Informix XA resource.
  • Configuring UBBCONFIG file to utilize the Informix XA resource.
  • Configuring the Setnet32.exe utility for the servers utilizing the Informix XA resource.
  • Developing programs to adhere to the constraints for the X/Open DTP environment.

After the above mentioned steps have been completed, use of the X/Open DTP XA scheme with the Informix resource manager should be successfully implemented in the Tuxedo System/T application.

~end of Aurora Information Systems White Paper Series #5
  "Informix XA Configuration for Tuxedo System/T on the Windows NT Platform"~

Return to Top of Page

Do you find this information interesting?

Consider employment with Aurora!

Do you need help implementing your Middleware app?
Aurora can make your life easier.

Copyright © 2005 Aurora Information Systems, Inc. All rights reserved.
voice (407) 708-1040  .   fax (407) 708-1039