IBM Support

ODBC Driver may not process correct results when connection pooling is enabled in Driver Manager

Troubleshooting


Problem

When connection pooling is enabled in Driver Manager, the ODBC Driver may not process the correct results.

Symptom

This could be observed if the client program makes selected queries in a loop and aborts the query while fetching the result. In such a scenario, subsequent query returns zero records.

Diagnosing The Problem

Enabling the connection pooling feature in the driver manager causes the same connection to be reused by clients even if the application it is written to free connection. As a result, for aborted queries, data over socket is not cleared in the proper manner. This leads to an incorrect result for the subsequent query.

Sample steps to reproduce:

1. Fire a select query in a continuous loop.


2. After few records are read, abort the query.
3. Print the no of rows fetched.

Output:
Rows : 256
Rows : 0
Rows : 256
Rows : 256
Rows : 256

Resolving The Problem

To avoid this issue we need to set the connection attribute “ConnectionPooling” to true. This attribute is available in IBM Netezza ODBC driver 7.2.1.4-P1 and onwards.
There are three methods to set this attribute:

1) DSN setting in Windows environment:

For Windows this attribute can be set in advanced DSN tab as shown below:


2) Non-Windows environment:

For non-Windows, this attribute needs to be set in odbc.ini

ConnectionPooling = true/false


3) This attribute can also be set in Connection string:

Example:

"servername=<server_name>;port=5480;database=<db_name>;username=<user_name>;password=xxxx;ConnectionPooling=1"



NOTE: The ConnectionPooling option in Netezza ODBC driver should be used ONLY IF the connection pooling feature is enabled in the driver manager; NOT otherwise.

[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Database","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
17 October 2019

UID

swg22003280