Details
Description
If I run TriggerTest with the flags -server and -Xmx150M passed to the JVM, I fairly consistently see a NPE being thrown:
java.lang.NullPointerException
at org.apache.derby.impl.sql.execute.GenericTriggerExecutor.executeSPS(GenericTriggerExecutor.java:221)
at org.apache.derby.impl.sql.execute.RowTriggerExecutor.fireTrigger(RowTriggerExecutor.java:114)
at org.apache.derby.impl.sql.execute.TriggerEventActivator.notifyEvent(TriggerEventActivator.java:281)
at org.apache.derby.impl.sql.execute.UpdateResultSet.fireAfterTriggers(UpdateResultSet.java:818)
at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:280)
at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:443)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:324)
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1242)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1715)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(EmbedPreparedStatement.java:1370)
at org.apache.derbyTesting.functionTests.tests.lang.TriggerTest.testBlobInTriggerTable(TriggerTest.java:880)
at org.apache.derbyTesting.functionTests.tests.lang.TriggerTest.testBlobInTriggerTable(TriggerTest.java:779)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.extensions.TestSetup.run(TestSetup.java:25)
at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
at junit.textui.TestRunner.doRun(TestRunner.java:121)
at junit.textui.TestRunner.start(TestRunner.java:185)
at junit.textui.TestRunner.main(TestRunner.java:143)
In derby.log, there is an OOME right before the NPE:
java.lang.OutOfMemoryError: Java heap space
at org.apache.derby.impl.jdbc.LOBStreamControl.updateData(LOBStreamControl.java:154)
at org.apache.derby.impl.jdbc.LOBStreamControl.write(LOBStreamControl.java:247)
at org.apache.derby.impl.jdbc.LOBStreamControl.<init>(LOBStreamControl.java:89)
at org.apache.derby.impl.jdbc.EmbedBlob.<init>(EmbedBlob.java:189)
at org.apache.derby.impl.jdbc.EmbedResultSet.getBlob(EmbedResultSet.java:4072)
at org.apache.derby.impl.jdbc.EmbedResultSet.getObject(EmbedResultSet.java:1704)
at org.apache.derby.exe.ac56961bb1x0137x0d04x3d17x00005ffb0f6356.e0(Unknown Source)
at org.apache.derby.impl.services.reflect.DirectCall.invoke(ReflectGeneratedClass.java:139)
at org.apache.derby.impl.sql.execute.RowResultSet.getNextRowCore(RowResultSet.java:148)
at org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(DMLWriteResultSet.java:127)
at org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:507)
at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:443)
at org.apache.derby.impl.sql.GenericPreparedStatement.executeSubStatement(GenericPreparedStatement.java:313)
at org.apache.derby.impl.sql.execute.GenericTriggerExecutor.executeSPS(GenericTriggerExecutor.java:176)
at org.apache.derby.impl.sql.execute.RowTriggerExecutor.fireTrigger(RowTriggerExecutor.java:114)
(...)
The code that fails with NPE, is this call to cleanupOnError() in a catch block in GenericTriggerExecutor.executeSPS():
/* retrieve the current active SC */
StatementContext sc = lcc.getStatementContext();
/* make sure that the cleanup is on the new SC */
if (active_sc != sc)
Attachments
Attachments
Issue Links
- relates to
-
DERBY-6289 Derby 10.8 backport issue (summer 2013)
- Closed