DB2 - Problembeschreibung
Problem IC77510 | Status: Geschlossen |
CLI FUNCTIONS RETURN SQL_SUCCESS EVEN WHEN SQL_ATTR_INSERT_BUFFE RING=SQL_ATTR_INSERT_BUFFERING_IGD and INSERT COMMAND FAILS | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problembeschreibung: | |
When a call level interface (CLI) application sets the statement attribute SQL_ATTR_INSERT_BUFFERING=SQL_ATTR_INSERT_BUFFERING_IGD and a row, that violates a uniqueness constraint, is inserted in an array input chain, the application ought to get the return value SQL_SUCCESS_WITH_INFO when the CLI array input chain is ended. And then when the application calls SQLRowCount, it ought to report just the number of rows that were successfully inserted, not including any rows that were rejected for violating a uniqueness constraint. As a result of this defect, the application gets the return value SQL_SUCCESS when the CLI array input chain is ended, and SQLRowCount reports the total number of executions of the INSERT statement, including those which violated a uniqueness constraint. This defect only affects applications that connect to a database that has more than one database partition. This defect does not affect DB2 Version 9.7 for Linux, UNIX and Windows before Fix Pack 1. The following pseudocode illustrates the problem. SQLRETURN sql_rc; SQLHANDLE hinsert; SQLINTEGER insertcount; /* Assuming that hinsert is a statement handle that has been allocated, set the statement attribute SQL_ATTR_INSERT_BUFFERING=SQL_ATTR_INSERT_BUFFERING_IGD. */ sql_rc = SQLSetStmtAttr( hinsert, SQL_ATTR_INSERT_BUFFERING, (SQLPOINTER) SQL_ATTR_INSERT_BUFFERING_IGD, 0 ); /* Prepare an INSERT statement. */ sql_rc = SQLPrepare( hinsert, "INSERT INTO MYTEST ( I ) VALUES( ? )", SQL_NTS ); /* Bind the parameters for the INSERT statement. */ sql_rc = SQLExtendedBind( hinsert, ... ); /* Begin an array input chain. */ sql_rc = SQLSetStmtAttr( hinsert, SQL_ATTR_CHAINING_BEGIN, (SQLPOINTER) TRUE, 0 ); /* Insert rows, at least one of which violate a uniqueness constraint. */ sql_rc = SQLExecute( hinsert ); sql_rc = SQLExecute( hinsert ); /* End the array input chain. This ought to set sql_rc to SQL_SUCCESS_WITH_INFO if any of the rows that were inserted violate a uniqueness constraint. But because of the defect it sets sql_rc to SQL_SUCCESS. */ sql_rc = SQLSetStmtAttr( hinsert, SQL_ATTR_CHAINING_END, (SQLPOINTER) TRUE, 0 ); printf( "SQL_ATTR_CHAINING_END returned sql_rc=%d\n", sql_rc); /* Call SetRowCount to set insertcount to the number of rows affected. This statement ought to set insertcount to just the number of rows that were inserted successfully. But because of the defect it sets insertcount to the total number of INSERT statements that were executed, including those which were rejected for violating the uniqueness constraint. */ SQLRowCount( hinsert, &insertcount ); printf( "SQLRowCount returned %d inserted rows\n", insertcount ); | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * Users of CLI (Call Level Interface) applications with DB2 * * for Linux, UNIX and Windows * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * . * **************************************************************** | |
Local-Fix: | |
As a workaround you can set the CLI configuration keyword Patch2=111. Setting the CLI configuration keyword Patch2=111 might affect the performance of inserts by CLI applications that set statement attribute SQL_ATTR_INSERT_BUFFERING to either SQL_ATTR_INSERT_BUFFERING_IGD or SQL_ATTR_INSERT_BUFFERING_ON. | |
verfügbare FixPacks: | |
DB2 Version 9.7 Fix Pack 5 for Linux, UNIX, and Windows | |
Lösung | |
Problem was first fixed in Version 9.7 Fix Pack 5. At a minimum this fix should be applied on the client. | |
Workaround | |
As a workaround you can set the CLI configuration keyword Patch2=111. Setting the CLI configuration keyword Patch2=111 might affect the performance of inserts by CLI applications that set statement attribute SQL_ATTR_INSERT_BUFFERING to either SQL_ATTR_INSERT_BUFFERING_IGD or QL_ATTR_INSERT_BUFFERING_ON. | |
Bug-Verfolgung | |
Vorgänger : APAR is sysrouted TO one or more of the following: IC77564 IC77565 IC77566 Nachfolger : | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 13.07.2011 31.10.2011 31.10.2011 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
9.7.FP5 | |
Problem behoben lt. FixList in der Version | |
9.7.0.5 |