[ 
https://issues.apache.org/jira/browse/DERBY-3870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-3870:
--------------------------------------

    Attachment: upgrade.diff

It looks like the problems are caused by the code that drops JDBC metadata 
queries and invalidates stored prepared statement on upgrade. This code scans 
through SYS.SYSSTATEMENTS and reads every column in every row of the table. 
When it comes across a statement that uses one of the XML operators, it fails 
to deserialize the old plan because it contains SqlXmlUtil instances in the 
savedObject field, and the SqlXmlUtil class doesn't implement Formatable 
anymore.

I think the fix is simple. See the attached patch upgrade.diff, which simply 
makes the upgrade code skip the column that contains the compiled plan. Then 
the upgrade code is able to fetch the stored statements from the system table 
and flag them as invalid.

I would like to add a test case for this in the upgrade tests, but it's a bit 
tricky since the XML operators aren't always available, and the requirements 
vary between different versions of Derby, so it's hard to determine whether or 
not the test case is expected to pass on the platform. I'll give it a try, 
though.

> Concurrent Inserts of rows with XML data results in an exception
> ----------------------------------------------------------------
>
>                 Key: DERBY-3870
>                 URL: https://issues.apache.org/jira/browse/DERBY-3870
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.1.3, 10.4.2.1, 10.5.2.0, 10.6.1.0
>         Environment: System: MS windows server 2003 standard edition service 
> pack 2. Derby is run as a server on port 1527.
>            Reporter: Royi Ronen
>            Assignee: Knut Anders Hatlen
>              Labels: derby_triage10_5_2
>             Fix For: 10.8.1.3, 10.9.0.0
>
>         Attachments: Copy of derby.log, DerbyMultiInsertXmlException.zip, 
> d3870-1a.diff, d3870-1a.stat, d3870-2a.diff, d3870-3a.diff, d3870-3a.stat, 
> d3870-junit.diff, upgrade.diff
>
>
> We insert rows into a table using the following prepared statement (through 
> JDBC):
> INSERT INTO USER1.PSTORE values(?,?, XMLPARSE(document CAST (? AS CLOB) 
> preserve whitespace))
> where each of the ?'s are replaced with a string.
> One thread runs fine. Two or more result in the following exception: 
> org.apache.derby.client.am.SqlException: Java exception: 'FWK005 parse may 
> not be called while parsing.: org.xml.sax.SAXException'.
>       at org.apache.derby.client.am.SqlException.<init>(Unknown Source)
>       at org.apache.derby.client.am.SqlException.<init>(Unknown Source)
> We believe that this comes from the dBuilder.parse(InputSource) method.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to