[ 
https://issues.apache.org/jira/browse/DERBY-6297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13751234#comment-13751234
 ] 

Knut Anders Hatlen commented on DERBY-6297:
-------------------------------------------

I think I found the problem. The disableXplainStyle() method invokes the plan 
exporter tool. The plan exporter calls getSchemas() from 
AccessDatabase.schemaExists(), but it does not explicitly close the JDBC result 
set returned by getSchemas(). Eventually garbage collection and finalization 
will mark the corresponding activation as not in use. Once it is marked as 
unused, the activation and its language result sets will be closed on the next 
(auto-) commit performed on the same connection. Saving statistics is driven 
from the close() method of the language result set, and if xplain has been 
enabled between the execution of the getSchemas() query and the actual closing 
of the result set, statistics may be saved unintentionally.
                
> Intermittent failures in XplainStatisticsTest.testSimpleXplainOnly
> ------------------------------------------------------------------
>
>                 Key: DERBY-6297
>                 URL: https://issues.apache.org/jira/browse/DERBY-6297
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.11.0.0
>            Reporter: Knut Anders Hatlen
>
> XplainStatisticsTest.testSimpleXplainOnly fails intermittently.
> Examples:
> http://download.java.net/javadesktop/derby/javadb-5579342-report/javadb-task-3689858.html
>     junit.framework.AssertionFailedError: Column value mismatch @ column '1', 
> row 1:
>     Expected: >1<
>     Found:    >2<
>       at 
> org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1278)
>       at 
> org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1190)
>       at 
> org.apache.derbyTesting.junit.JDBC.assertFullResultSetMinion(JDBC.java:1077)
>       at 
> org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:1000)
>       at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:957)
>       at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:915)
>       at 
> org.apache.derbyTesting.junit.JDBC.assertSingleValueResultSet(JDBC.java:900)
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.XplainStatisticsTest.testSimpleXplainOnly(XplainStatisticsTest.java:1148)
>       at 
> org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
>       at 
> org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:439)
>       at 
> org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:456)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at 
> org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> http://download.java.net/javadesktop/derby/javadb-5579365-report/javadb-task-3690182.html
>     junit.framework.AssertionFailedError: Column value mismatch @ column '1', 
> row 1:
>     Expected: >4<
>     Found:    >7<
>       at 
> org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1278)
>       at 
> org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1190)
>       at 
> org.apache.derbyTesting.junit.JDBC.assertFullResultSetMinion(JDBC.java:1077)
>       at 
> org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:1000)
>       at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:957)
>       at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:915)
>       at 
> org.apache.derbyTesting.junit.JDBC.assertSingleValueResultSet(JDBC.java:900)
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.XplainStatisticsTest.testSimpleXplainOnly(XplainStatisticsTest.java:1183)
>       at 
> org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
>       at 
> org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:439)
>       at 
> org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:456)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at 
> org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to