[ 
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-with-test.diff

Thanks for taking a look at the patch, Bryan. I'm uploading a new patch which 
adds a test case for the upgrade scenario. The test creates a trigger using the 
old version and verifies that the trigger works after upgrading. Without the 
fix in the data dictionary, the test fails to boot the database with the new 
version.

I think the test handles all combinations of XML ops being 
supported/not-supported with the old/new Derby version in the running 
environment. The different cases are handled like this:

1) If XML ops aren't supported with the new version, the test case is disabled 
in the test setup (we have helper methods to detect this).

2) If XML ops are supported with the new version, but not with the old version, 
the test case runs, but it will detect that CREATE TRIGGER fails with an 
exception saying XML requirements aren't satisfied. It will immediately return 
without reporting a failure.

3) If the situation described in (2) happens, the test case will run in all 
phases (create, soft-upgrade, post-soft-upgrade, hard-upgrade), but there is no 
trigger to test. The test case queries the system tables to see if the trigger 
has been created, and returns immediately if the trigger doesn't exist.

4) Since XML operators aren't supported at all before version 10.2, and 
creating the trigger will fail with a different exception than the one we 
detect as XML requirements not satisfied, the test case is made a no-op if the 
tested combination uses a too old version. (Actually, it only tests upgrade 
from 10.3 and newer now. That's because the CREATE TRIGGER statement fails on 
10.2 because it lacks the fix for DERBY-1770.)

All regression tests passed in my environment.

> 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-with-test.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