[
https://issues.apache.org/jira/browse/DERBY-4198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12705610#action_12705610
]
Dag H. Wanvik commented on DERBY-4198:
--------------------------------------
There are actually two errors in this issue.
The first is the underlying error which has this stack trace (disguised by
error 2, see below):
Error 1
-------
1)
testReproduction(org.apache.derbyTesting.functionTests.tests.store.ReproHoldCursorBug)java.sql.SQLException:
Java exception: ': java.lang.NullPointerException'.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:87)
at org.apache.derby.impl.jdbc.Util.javaException(Util.java:244)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
at
org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2201)
at
org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
at
org.apache.derby.impl.jdbc.EmbedResultSet.updateRow(EmbedResultSet.java:3743)
at
org.apache.derbyTesting.functionTests.tests.store.ReproHoldCursorBug.testReproduction(ReproHoldCursorBug.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at
org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:105)
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)
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)
Caused by: java.sql.SQLException: Java exception: ':
java.lang.NullPointerException'.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
... 36 more
Caused by: java.lang.NullPointerException
at
org.apache.derby.iapi.store.access.BackingStoreHashtable.getEstimatedMemUsage(BackingStoreHashtable.java:533)
at
org.apache.derby.iapi.store.access.BackingStoreHashtable.spillToDisk(BackingStoreHashtable.java:481)
at
org.apache.derby.iapi.store.access.BackingStoreHashtable.add_row_to_hash_table(BackingStoreHashtable.java:403)
at
org.apache.derby.iapi.store.access.BackingStoreHashtable.putRow(BackingStoreHashtable.java:731)
at
org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.addRowToHashTable(ScrollInsensitiveResultSet.java:992)
at
org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.updateRow(ScrollInsensitiveResultSet.java:1125)
at
org.apache.derby.impl.sql.execute.CurrentOfResultSet.updateRow(CurrentOfResultSet.java:334)
at
org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.updateRow(ProjectRestrictResultSet.java:587)
at
org.apache.derby.impl.sql.execute.NormalizeResultSet.updateRow(NormalizeResultSet.java:407)
at
org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:560)
at
org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:254)
at
org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:416)
at
org.apache.derby.impl.sql.GenericPreparedStatement.executeSubStatement(GenericPreparedStatement.java:286)
at
org.apache.derby.impl.jdbc.EmbedResultSet.updateRow(EmbedResultSet.java:3722)
... 29 more
Error 2
-------
The error handling in EmbedResultSet.updateRow performs a redundant
call to popStatementContext causing the assert error seen.
There is a missing catch of Throwable at the end:
:
} catch (Throwable t) {
throw handleException(t);
} finally {
:
}
This handling is lacking from insertRow and deleteRow as well.
> When using the FOR UPDATE OF clause, the updateRow() method crashes
> -------------------------------------------------------------------
>
> Key: DERBY-4198
> URL: https://issues.apache.org/jira/browse/DERBY-4198
> Project: Derby
> Issue Type: Bug
> Components: JDBC, Network Client
> Affects Versions: 10.6.0.0
> Reporter: Tiago R. Espinha
> Attachments: ErrorOutput_Client.tar.gz, ErrorOutput_Embedded.tar.gz,
> ReproHoldCursorBug.java
>
>
> This problem occurs on both Client/Server and Embedded.
> With the Embedded driver, the JVM crashes with the following error:
> -------------------------------------8<------------------------------------
> 1)
> testReproduction(org.apache.derbyTesting.functionTests.tests.store.ReproHoldCursorBug)org.apache.derby.shared.common.sanity.AssertFailure:
> ASSERT FAILED statementContext is not expected to equal statementContexts[0]
> at
> org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:120)
> at
> org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.popStatementContext(GenericLanguageConnectionContext.java:2286)
> at
> org.apache.derby.impl.jdbc.EmbedResultSet.updateRow(EmbedResultSet.java:3740)
> at
> org.apache.derbyTesting.functionTests.tests.store.ReproHoldCursorBug.testReproduction(ReproHoldCursorBug.java:71)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at
> org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:105)
> 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)
> ------------------------------------8<---------------------------------------------
> (It shows a stack trace after this, but I'm attaching the result folders
> since those are more thorough.)[1]
> On the client driver, the JVM does not crash but it also errors out:
> 1)
> testReproduction(org.apache.derbyTesting.functionTests.tests.store.ReproHoldCursorBug)java.sql.SQLException:
> DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC:
> java.lang.NullPointerExceptionXJ001.U
> (more detail on the log files)[2]
> The error does not show as long as the "OF DATA" isn't specified. It also
> won't show if the whole FOR UPDATE clause is omitted.
> I would also like some comments and advice on how to proceed on converting
> holdCursorJDBC30.sql as it is affected by this problem. The original test
> does an update on a cursor with the "FOR UPDATE OF DATA" clause, and this
> isn't working on the Java version of the test. Do I go around it by removing
> the FOR UPDATE clause or should I wait for this bug to get fixed?
> Attachments:
> [1] - ErrorOutput_Embedded.tar.gz - Error output files of the Embedded run
> [2] - ErrorOutput_Client.tar.gz - Error output files of the Client/Server run
> [3] - ReproHoldCursorBug.java - The reproduction of the errors
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.