Process-based XA-compliant Transaction Program Monitor (XA TP) programming considerations for CLI applications
Process-based XA transaction
managers, such as a CICS® server,
start one application server per process. In each application-server
process, the connections are established by using the XA API (xa_open).
Configuration
The XA Transaction Manager must be set up according to the configuration considerations for XA transaction managers.
Note: Setting the CLI/ODBC configuration
keywords for connections is no longer required when in an XA Transactional
processing environment.
Programming considerations
CLI/ODBC
applications written for this environment must complete the following
steps:
- The application must first call
SQLConnect()
orSQLDriverConnect()
to associate the TM-opened connections with the CLI/ODBC connection handle. The data source name must be specified. User ID and Password are optional. - The application must call the XA TM to do a commit or rollback.
As a result, since the CLI/ODBC
driver does not know that the transaction has ended, the application
should do the following tasks before exiting:
- Drop all CLI/ODBC statement handles.
- Free up the connection handle by calling
SQLDisconnect()
andSQLFreeHandle()
. The actual database connection will not be disconnected until the XA TM performs an xa_close.
Restrictions
Mixing embedded SQL and CLI/ODBC calls in a multisite update environment is supported, but all the same restrictions of writing mixed applications are imposed.