Error removing object from a paginated list after the object was deleted and the context committed
--------------------------------------------------------------------------------------------------
Key: CAY-1054
URL: https://issues.apache.org/cayenne/browse/CAY-1054
Project: Cayenne
Issue Type: Bug
Components: Cayenne Core Library
Affects Versions: 3.0
Reporter: Andrus Adamchik
Assignee: Andrus Adamchik
Priority: Minor
Fix For: 3.0
This code explodes in remove:
SimpleIdIncrementalFaultList<Artist> list = new SimpleIdIncrementalFaultList<Artist>(
context,
query);
assertEquals(25, list.size());
Artist a1 = list.get(0);
context.deleteObject(a1);
context.commitChanges();
list.remove(0);
org.apache.cayenne.CayenneRuntimeException: [v.${project.version} ${project.build.date} ${project.build.time}] Query exception.
at org.apache.cayenne.access.DataDomainQueryAction.nextQueryException(DataDomainQueryAction.java:551)
at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:237)
at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:424)
at org.apache.cayenne.access.DataDomainQueryAction.access$0(DataDomainQueryAction.java:403)
at org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:397)
at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:394)
at org.apache.cayenne.access.UnitTestDomainQueryAction.runQueryInTransaction(UnitTestDomainQueryAction.java:55)
at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:120)
at org.apache.cayenne.access.UnitTestDomainQueryAction.execute(UnitTestDomainQueryAction.java:49)
at org.apache.cayenne.access.UnitTestDomain.onQuery(UnitTestDomain.java:63)
at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:317)
at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1336)
at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1325)
at org.apache.cayenne.access.IncrementalFaultList.resolveInterval(IncrementalFaultList.java:353)
at org.apache.cayenne.access.IncrementalFaultList.get(IncrementalFaultList.java:608)
at org.apache.cayenne.access.IncrementalFaultList.remove(IncrementalFaultList.java:641)
at org.apache.cayenne.access.SimpleIdIncrementalFaultListTest.testRemoveDeleted(SimpleIdIncrementalFaultListTest.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
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:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.NullPointerException
at org.apache.cayenne.access.trans.QualifierTranslator.appendObjectMatch(QualifierTranslator.java:140)
at org.apache.cayenne.access.trans.QualifierTranslator.endNode(QualifierTranslator.java:324)
at org.apache.cayenne.exp.Expression.traverse(Expression.java:470)
at org.apache.cayenne.exp.Expression.traverse(Expression.java:441)
at org.apache.cayenne.access.trans.QualifierTranslator.doAppendPart(QualifierTranslator.java:67)
at org.apache.cayenne.access.trans.QueryAssemblerHelper.appendPart(QueryAssemblerHelper.java:72)
at org.apache.cayenne.access.trans.SelectTranslator.createSqlString(SelectTranslator.java:107)
at org.apache.cayenne.dba.hsqldb.HSQLSelectTranslator.createSqlString(HSQLSelectTranslator.java:34)
at org.apache.cayenne.access.trans.QueryAssembler.createStatement(QueryAssembler.java:116)
at org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:72)
at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:58)
at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:230)
... 35 more
-- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
This archive was generated by hypermail 2.0.0 : Mon May 12 2008 - 11:30:19 EDT