DB2 - Problembeschreibung
| Problem IC94283 | Status: Geschlossen |
SQLSetEnvAttr() WITH SQL_ATTR_DB2TRC_STARTUP MAY FAIL WITH SQL_INVALID_HANDLE ERROR | |
| Produkt: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
| Problembeschreibung: | |
If you have an application that is calling SQLSetEnvAttr() with
SQL_ATTR_DB2TRC_STARTUP attribute
and you compiled this application under DB2 9.7 FP8, this same
application may fail with SQL_INVALID_HANDLE (-2) under 10.1 FP2
due to the way
SQL_ATTR_DB2TRC_STARTUP is defined across those versions.
From 10.1 FP2 sqlcli1.h :
#define SQL_ATTR_DB2TRC_STARTUP_SIZE 3019
From 9.7 FP8 sqlcli1.h :
#define SQL_ATTR_DB2TRC_STARTUP_SIZE 3017
Example :
Compile the following program under DB2 9.7 FP8 :
#include <sqlcli1.h>
int main()
{
SQLRETURN cliRC = SQL_SUCCESS;
cliRC = SQLSetEnvAttr(SQL_NULL_HENV,
SQL_ATTR_DB2TRC_STARTUP_SIZE,
(SQLPOINTER) 32, SQL_IS_UINTEGER );
if (cliRC != 0)
{
printf(" cliRC = %d\n", cliRC);
return cliRC;
}
else printf(" OK : %d\n", cliRC);
return 0;
}
Execute it under DB2 9.7 FP8 :
$ ./test
cliRC = 0
CLI traces show :
SQLSetEnvAttr( hEnv=0:0,
fAttribute=SQL_ATTR_DB2TRC_STARTUP_SIZE, vParam=32, cbParam=-5 )
---> Time elapsed - 0 seconds
SQLSetEnvAttr( )
<--- SQL_SUCCESS Time elapsed - +3.087500E-002 seconds
Now, if you run the same application under DB2 10.1 FP2 :
$ ./test
cliRC = -2
The CLI traces show :
SQLSetEnvAttr( )
<--- SQL_INVALID_HANDLE Time elapsed - +3.900000E-005
seconds | |
| Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * DB2 CLI applications * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 9.7 FP9 or above * **************************************************************** | |
| Local-Fix: | |
Recompile your application under the DB2 version you wish to execute it. | |
| verfügbare FixPacks: | |
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows | |
| Lösung | |
The problem was first fixed in DB2 9.7 FP9 Now the define will be as #define SQL_ATTR_DB2TRC_STARTUP_SIZE 3019 | |
| Workaround | |
keiner bekannt / siehe Local-Fix | |
| Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 22.07.2013 23.12.2013 23.12.2013 |
| Problem behoben ab folgender Versionen (IBM BugInfos) | |
9.7.FP9 | |
| Problem behoben lt. FixList in der Version | |
| 9.7.0.9 |
|
| 9.7.0.9 |
|