DB2 - Problem description
Problem IC68198 | Status: Closed |
SQLFREEHANDLE() for environment handle in CLI application returns -1 on DB2 V9.7 FP1 | |
product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problem description: | |
SQLFreeHandle() for environment handle in CLI application returns 0 on DB2 V9.7 GA. However, it returns -1 on DB2 V9.7 FP1. We can reproduce this issue. Here is a part of the application code and its result. $ cat cli01.c ...(snip)... int main(int argc, char *argv[]) { ...(snip)... printf("\n Disconnecting from %s...\n", dbAlias); cliRC = SQLDisconnect(hdbc); DBC_HANDLE_CHECK(hdbc, cliRC); . printf(" Disconnected from %s.\n", dbAlias); . /* free connection handle */ cliRC = SQLFreeHandle(SQL_HANDLE_DBC, hdbc); DBC_HANDLE_CHECK(hdbc, cliRC); . /* free environment handle */ cliRC = SQLFreeHandle(SQL_HANDLE_ENV, henv); printf("cliRC = [%d]\n", cliRC); ENV_HANDLE_CHECK(henv, cliRC); . return rc; } /* main */ This problem occurs only when we build it as 32-bit application on V9.7 FP1. like the following(badcase): xlc -I/home/v97fp1/sqllib/include -c cli01.c xlc -o cli01 cli01.o -L/home/v97fp1/sqllib/lib32 -ldb2 On the other hand, this problem does not occur if we compile it as 64-bit. Application issues SQLFreeHandle twice. The first one for SQL_HANDLE_DBC succeeds with rc 0, but the second one for SQL_HANDLE_ENV gets RC -1 even though cli trace shows SQL_SUCCESS. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * V97 FP1 or FP2 user * **************************************************************** * PROBLEM DESCRIPTION: * * SQLFreeHandle() for environment handle in CLI application * * * * returns 0 on DB2 V9.7 GA. * * * * However, it returns -1 on DB2 V9.7 FP1. * * Problem occurs only when we build it as 32-bit application * * on * * V9.7 FP1. * * On the other hand, this problem does not occur if we compile * * it as 64-bit. * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 Version 9.7 Fix Pack 3. * **************************************************************** | |
Local Fix: | |
available fix packs: | |
DB2 Version 9.7 Fix Pack 3 for Linux, UNIX, and Windows | |
Solution | |
Problem was first fixed in V9.7 FP3. | |
Workaround | |
not known / see Local fix | |
BUG-Tracking | |
forerunner : APAR is sysrouted TO one or more of the following: IC68787 follow-up : | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 26.04.2010 03.10.2010 03.10.2010 |
Problem solved at the following versions (IBM BugInfos) | |
9.7.FP3 | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.7.0.3 | |
9.7.0.3 |