[
https://issues.apache.org/jira/browse/DERBY-3823?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dag H. Wanvik updated DERBY-3823:
---------------------------------
Attachment: d3823-1.diff
Uploading a trial patch to EmbedPreparedStatement#getMetaData which changes the
logic to detect if a prepared statement has been/is the the process of being
recompiled as we are trying to get the metadata. It should avoid the race
condition in the existign code where it can happen that we try to get the ps's
activation class while it is being recompiled (hence is null temporarily).
Even if with the patch, we get a consistent picture of the ps's current
activation class and result description (my hope), I am not sure I understand
how this approach is always correct: We are trying to get metadata for a result
set. If the prepared statement has been invalidated (i.e. recompiled), I wonder
if the ResultDescription will still necessarily be correct for that result set?
Perhaps it will, since if the some change were to occur to the table that would
change the column information, presumably, such changes would block on the fact
that the result set was still open (?). At least on embedded that seems
reasonable assumption. On client/server I think we can possible close the
result set as a result of prefetching rows, so I am not sure if this always
holds. But maybe the retrieval of the metadata happens before the time the
result set is closed.. Can anyone shed light on this?
In any case, I will try to run the test for some time with the new patch and
see what happens...
> NullPointerException in stress.multi test
> -----------------------------------------
>
> Key: DERBY-3823
> URL: https://issues.apache.org/jira/browse/DERBY-3823
> Project: Derby
> Issue Type: Bug
> Components: Network Server
> Affects Versions: 10.3.3.1, 10.7.1.1, 10.8.1.2
> Reporter: Kathey Marsden
> Labels: derby_triage10_5_2
> Attachments: d3823-1.diff, derby.log
>
>
> I saw the following NPE in stress.multi running on 10.3 with derbyclient.
> java.lang.NullPointerException
> at
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.getMetaData(Unknown
> Source)
> at org.apache.derby.impl.drda.DRDAConnThread.writeSQLDARD(Unknown
> Source
> )
> at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
> Sou
> rce)
> at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
> Cleanup action completed
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira