Created On:  17 November 2010

Problem:

Is it possible to execute JES-initiated transactions which require database connectivity from within Enterprise Server?

Attempting to execute JES initiated transactions results in :
CASXO0016S XA interface initialization failure
CASXO0001S XA Resource Manager initialization error. Resource DB2T open failed, reason  00000

ES region initialisation shows
CASXO0022W XA interface local transaction support disabled

NOTE: This article applies only to Net Express 5.0 WrapPack 3 or later, or Server Express 5.0 WrapPack 3 or later.

Resolution:

The implementation of database access under ES/MTO from JES-initiated transactions -- that is, using IKJEFT01 -- has changed slightly within the Net Express 5.0 and Server Express 5.0 WrapPack 3 deliveries (or WrapPack 4 on non-AIX platforms) from earlier Net Express and Server Express 5.0 product releases.

This article summarises the changes required in order to utilise this support:

* The XA Resource Manager definitions should be made as they would with earlier product releases.

* If using the Oracle (ESORAXA.CBL) or DB/2 (ESDB2XA.CBL) switch modules, you now have to build an additional module, in addition to rebuilding the existing module. The build script shipping with both Net Express and Server Express includes two new options, as follows:

1. For applications using precompiled Oracle -- i.e. Pro*COBOL or Cobsql. In addition to rebuilding the existing Oracle switch module, i.e. build ora, you must also build a second module :

Option: ora1pc
Usage : build ora1pc
Description: Builds an additional switch module for use with JES-initiated tasks via IKJEFT01 connecting to Oracle data sources.

2. For applications using precompiled DB2 -- i.e. precompiled with db2 prep, or compiled with the DB2 compiler directive. In addition to rebuilding the existing DB2 switch module, i.e. build db2, you must also build a second module:

Option : db21pc
Usage : build db21pc DB2_DATABASE_ALIAS [ DB2_USERID DB2_PASSWORD]

where:

DB2_DATABASE_ALIAS : A database alias cataloged to the DB2 client on the machine where Enterprise Server is running
DB2_USERID, DB2_PASSWORD : Optional user ID and password for connecting to DB2, if different from the currently logged in user.

For example,
build db21pc SAMPLE db2inst1 db2passwd

Description: Builds an additional switch module for use with JES-initiated tasks via IKJEFT01 connecting to IBM DB2 data sources using precompiled DB2 applications.

3. For applications connecting to SQL Server. In addition to building the existing SQL Server XA switch module, i.e. build mssql, you must also build the ODBC one-phase commit switch module, i.e. build odbc

4. For applications using the existing ODBC one-phase commit switch module, no changes will be required.

NOTES:
A. For cases 1-3, the additional module:
* DB2 - ESDB2OPC.dll/.so/.sl
* Oracle - ESORAOPC.dll/.so/.sl
* SQL Server XA - ESODBCXA.dll

needs to be loadable by the main switch module. This second switch module must therefore be located on :

* PATH - Windows
* LIBPATH - AIX
* SHLIB_PATH - HP/UX PA-RISC
* LD_LIBRARY_PATH - Other flavors of UNIX

at the time when the ES region starts up.

Not having done this can lead to the errors cited in the Problem section above.

The error can also occur if both the existing (XA) and one-phase commit modules are not both rebuilt after applying the product update.

B. For cases 3 and 4, if you have WrapPack 3 installed, you should download the files attached to this article, and use these updated modules, noting that any previous changes to compiler directives should be reapplied to the updated source files.