Skip to main content

DB2 for i5/OS

Developing Distributed Applications with DB2 UDB for iSeries and Microsoft MTS

Setup

To work with the Client Access ODBC driver under MTS, you need to change the following system settings on the Windows system.

  1. Turn off the OLE DB Session Pooling for MSDASQL
    To turn off the OLE DB Session Pooling for MSDASQL, perform the following steps:
    - Start the Registry Editor (Regedt32.exe).
    - Locate the OLEDB_SERVICES value under the following key in the registry:
        HKEY_CLASSES_ROOT\CLSID\{c8b522cb-5cf3-11ce-ade5-00aa0044773d}\
    - On the Edit menu, click DWORD and type: 0xfffffffc then, click OK.
    - End the Registry Editor.
  2. Turn on the ODBC Connection Pooling
    Use the ODBC Administration dialog to turn on the ODBC Connection Pooling. On the ODBC Administrator dialog, click the Connection Pooling tab. Find the Client Access ODBC driver (32-bit) and double click it. A Set Connection Pooling Attribute dialog appears. Select Pool Connections to this driver. Set the time out value to be larger than the default value of 60 seconds. You may need to experiment with this value to figure out what works best for you. In this example, the value was set to 1000.
  3. Make sure that the isolation level is set to something higher than *NONE, for example *CHG.
    On the Client Access Express ODBC setup dialog, click Server tab and then Advanced button. The isolation levels are under Commit mode. The default setting for the iSeries ODBC driver is *CHG (read uncommitted).

    Additionally, the AUTOCOMMIT parameter, which by default is ON, MUST not be changed. The Client Access ODBC driver internally sets this parameter to OFF if your component is registered under MTS as Requires Transaction (see Sample Application below). The driver throws an exception if you explicitly try to set the AUTOCOMMIT to OFF. The Client Access ODBC driver internally changes this value as required.

[ Prev | Next ]

 
  Table of contents
->Introduction
->Prerequisites
->Setup
->Sample Application
->Troubleshooting
->Conclusion
->

Sample Application Source Code