home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Neueste VersionenFixList
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Haben Sie Probleme? - Kontaktieren Sie uns.
Kostenlos registrieren anmeldung-x26
Kontaktformular kontakt-x26

DB2 - Problembeschreibung

Problem IC77565 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 / 950 - 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.5 for Linux, UNIX and Windows before Fix 
Pack 5. 
 
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.5 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 10 for Linux, UNIX, and Windows

Lösung
Problem was first fixed in Version 9.5 Fix Pack 9. 
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 SQL_ATTR_INSERT_BUFFERING_ON.
Weitere Daten
Datum - Problem gemeldet    :
Datum - Problem geschlossen :
Datum - der letzten Änderung:
15.07.2011
07.03.2012
07.03.2012
Problem behoben ab folgender Versionen (IBM BugInfos)
9.5.FP9
Problem behoben lt. FixList in der Version
9.5.0.9 FixList