DB2 - Problem description
Problem IT17826 | Status: Closed |
SAXEXCEPTION CAUSED BY DB2 SERVER CACHES XMLFORMAT SETTING | |
product: | |
DB2 FOR LUW / DB2FORLUW / A10 - DB2 | |
Problem description: | |
Once set xmlFormat property remains cached on DB2 Server side for each query (accessing XML column). When this query is executed again with different xmlFormat value, then the XML data format remains unchanged and Java application may terminate with the following exception: [1073][12715][4.14.122] Caught java.io.IOException. See attached Throwable for details. ERRORCODE=-4228, SQLSTATE=null at com.ibm.db2.jcc.am.ed.a(ed.java:661) at com.ibm.db2.jcc.am.ed.a(ed.java:60) ... at java.lang.Thread.run(Thread.java:773) Caused by: java.io.IOException: org.xml.sax.SAXException: ERROR: Incorrect document identifier. at com.ibm.db2.jcc.b.b.a.read(a.java:92) at com.ibm.db2.jcc.b.b.a.read(a.java:38) at com.ibm.db2.jcc.am.pe.b(pe.java:584) ... 88 more Caused by: org.xml.sax.SAXException: ERROR: Incorrect document identifier. at com.ibm.db2.jcc.b.m.b(m.java:159) at com.ibm.db2.jcc.b.m.a(m.java:44) at com.ibm.db2.jcc.b.b.a.read(a.java:63) ... 90 more This exception can be reproduced using eg. the following code. First application is connecting with default xmlFormat settings (textual): conProperties.put("xmlFormat", "-2147483647"); stmt = con.prepareStatement("select XML_COLUMN from XML_TABLE where id = ?"); stmt.setInt(1,1); rs = stmt.executeQuery(); ... result = rs.getString(XML_COLUMN); when the application is connecting for the second time and settings changes for binary the exceptions is rised: conProperties.put("xmlFormat", "1"); Using the above example, the following statement will be stored in dynamic cache: select XML_COLUMN from XML_TABLE where id = ? and can be viewed by issuing: db2pd -dynamic -d <db_name> There are two workarounds available: 1/ use command "flush package cache" - this could have potential performance implications 2/ change the affected query by eg. adding random value at the end of the query eg. stmt = con.prepareStatement("select XML_COLUMN from XML_TABLE where id = ? /*" + RANDOM_VALUE + "*/"); | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 10.1 Fix Pack 6 * **************************************************************** | |
Local Fix: | |
Solution | |
First fixed in DB2 10.1 Fix Pack 6 | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 07.11.2016 02.03.2017 02.03.2017 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) |