Generic One-phase Commit for ODBC RM Switch Module

Provides the information required to build the generic one-phase commit for ODBC RM switch module.

Windows Environments

Source Code
The generic one-phase commit for ODBC RM switch module COBOL source file, ESODBCXA.CBL is located by default in the %ProgramFiles(x86)%\Micro Focus\Enterprise Developer\src\enterpriseserver\xa directory.
Note: If you prefer to supply user credentials programmatically rather than in the xa_open string, instructions for doing so are provided in the COBOL source file in the Customization section.
Build Requirements
To build the ODBC RM switch module, you must have the Windows Software Development Kit (SDK) installed for your version of Windows.

Before building this switch module, ensure that your LIB environment variable contains the path to the odbc32.lib file, located in a subdirectory under your Windows SDK LIB directory.

Some OpenESQL directives are process-based, and typically need to be set in within the code of the program that makes the database connection.

If you are executing services under Enterprise Server that are deployed as container-managed applications, the applicable directives must be specified when compiling the RM switch module, rather than when compiling your program source. For more information, see the list of Process-based OpenESQL directives in the topic Scope - OpenESQL SQL Compiler Directive Options.

Building the Switch Module
Method 1
  1. Start an Enterprise Developer command prompt, 32-bit or 64-bit depending on the application, running as an administrator.
  2. Change to the %ProgramFiles(x86)%\Micro Focus\Enterprise Developer\src\enterpriseserver\xa directory (default location).
  3. Enter build odbc
Method 2
  1. Start an Enterprise Developer command prompt, 32-bit or 64-bit depending on the application.
  2. Copy all files from the %ProgramFiles(x86)%\Micro Focus\Enterprise Developer\src\enterpriseserver\xa directory (default location) to any location where you have WRITE permission.
  3. Change to the directory containing the copied files.
  4. Enter build odbc
Build Output
The build process produces two binary RM switch module files from the ESODBCXA.CBL COBOL source file:
File Type
ESODBCXA.DLL static
ESODBCXA_D.DLL dynamic

You can register an RM switch module with Enterprise Server dynamically, or register it statically depending on which binary file you use. Micro Focus recommends that you use the dynamic switch module option, as this ensures that only active databases used in the global transaction participate in the TM/RM XA flow.

UNIX Environments

Source Code
The generic one-phase commit for ODBC RM switch module COBOL source file, ESODBCXA.CBL is located by default in the $COBDIR/src/enterpriseserver/xa directory.
Note: If you prefer to supply user credentials programmatically rather than in the xa_open string, instructions for doing so are provided in the COBOL source file in the Customization section.
Build Requirements
The build script uses the current effective working mode to determine how to build the switch module. Before invoking the build script, ensure that your database environment is set up correctly. For details see your database vendor's documentation.
Building the Switch Module
The $COBDIR/src/enterpriseserver/xa directory contains the build script file that you can use to build the switch module.
  1. Copy all files from the $COBDIR/src/enterpriseserver/xa directory (default location) to any location where you have WRITE permission.
  2. Change to the directory containing the copied files.
  3. Enter build odbc
Build Output
The build process produces four binary RM switch module files from the ESODBCXA.CBL COBOL source file:
ESODBCXA.so 32-bit static
ESODBCXA64.so 64-bit static
ESODBCXA_D.so 32-bit dynamic
ESODBCXA64_D.so 64-bit dynamic

You can register an RM switch module with Enterprise Server dynamically, or register it statically depending on which binary file you use. Micro Focus recommends that you use the dynamic switch module option, as this ensures that only active databases used in the global transaction participate in the TM/RM XA flow.

All Environments

Limitations
The ODBC module supports only a one-phase commit, therefore the following SQL operations are not supported in the source for your deployed container-managed service:
  • CONNECT
  • DISCONNECT
  • BEGIN TRANSACTION
  • COMMIT
  • ROLLBACK
Additional Resources
For more information on using the ODBC RM switch module, including the xa_open string definition, see Generic One-phase Commit for ODBC RM xa_open string.