Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

org.neo4j.helpers.ThisShouldNotHappenError: Developer: Andres claims that: This execution plan should not exist. when updating from 1.8 to 1.8.1 #395

Closed
SchulteMarkus opened this Issue · 4 comments

4 participants

Markus Schulte Michael Hunger Armen Andres Taylor
Markus Schulte

Hi,

when updating from neo4j 1.8 to 1.8.1 I get a new exception[1].

Short description: I have two entities, company and product, which are 1..n related to each other. When saving a product with a set company, the exception is thrown. Product is savable when no company is set.

I am using Spring Data neo4j RC4

Here are the relevant parts:

public class Company ... {
...
@Fetch
@RelatedTo(type = "sells")
protected Set<Product> products;
...
}

public class Product ... implements Cloneable {
...
@Fetch
@RelatedTo(type = "sells", direction = Direction.INCOMING)
@NotNull
protected Company company;
...
}

(Spring-data-neo4j) Debugging ends when failing at:
14:10:06.274 [main] DEBUG o.s.d.n.mapping.EntityInstantiator - Using class domain.entities.Product no-arg constructor
14:10:06.315 [main] DEBUG o.s.d.n.s.query.CypherQueryEngine - Executing cypher query: START company=node({self}) MATCH company<-[:orderAtCompany]-orderNode WHERE NOT company-[:accepts|denies]->orderNode RETURN orderNode ORDER BY orderNode.created params {self=1}
14:10:06.315 [main] DEBUG o.s.d.n.s.query.CypherQueryEngine - Executing cypher query: START company=node({self}) MATCH company-[:sells]->products WHERE NOT products<-[:covers]-() RETURN products ORDER BY products.name params {self=1}

Debugging when using neo4j 1.8:
14:12:03.022 [main] DEBUG o.s.d.n.mapping.EntityInstantiator - Using class domain.entities.Product no-arg constructor
14:12:03.073 [main] DEBUG o.s.d.n.s.query.CypherQueryEngine - Executing cypher query: START company=node({self}) MATCH company<-[:orderAtCompany]-orderNode WHERE NOT company-[:accepts|denies]->orderNode RETURN orderNode ORDER BY orderNode.created params {self=1}
14:12:03.073 [main] DEBUG o.s.d.n.s.query.CypherQueryEngine - Executing cypher query: START company=node({self}) MATCH company-[:sells]->products WHERE NOT products<-[:covers]-() RETURN products ORDER BY products.name params {self=1}
14:12:03.098 [main] DEBUG o.s.d.n.s.query.CypherQueryEngine - Executing cypher query: START company=node({self}) MATCH company<-[:orderAtCompany]-orderNode WHERE NOT company-[:accepts|denies]->orderNode RETURN orderNode ORDER BY orderNode.created params {self=1}
14:12:03.099 [main] DEBUG o.s.d.n.s.query.CypherQueryEngine - Executing cypher query: START company=node({self}) MATCH company-[:sells]->products WHERE NOT products<-[:covers]-() RETURN products ORDER BY products.name params {self=1}
14:12:03.103 [main] DEBUG o.s.d.n.s.query.CypherQueryEngine - Executing cypher query: START company=node({self}) MATCH company<-[:orderAtCompany]-orderNode WHERE NOT company-[:accepts|denies]->orderNode RETURN orderNode ORDER BY orderNode.created params {self=1}
14:12:03.103 [main] DEBUG o.s.d.n.s.query.CypherQueryEngine - Executing cypher query: START company=node({self}) MATCH company-[:sells]->products WHERE NOT products<-[:covers]-() RETURN products ORDER BY products.name params {self=1}
14:12:03.110 [main] DEBUG o.s.d.n.s.query.CypherQueryEngine - Executing cypher query: START company=node({self}) MATCH company<-[:orderAtCompany]-orderNode WHERE NOT company-[:accepts|denies]->orderNode RETURN orderNode ORDER BY orderNode.created params {self=1}
14:12:03.110 [main] DEBUG o.s.d.n.s.query.CypherQueryEngine - Executing cypher query: START company=node({self}) MATCH company-[:sells]->products WHERE NOT products<-[:covers]-() RETURN products ORDER BY products.name params {self=1}

[1] In DomainTest.java:155 the new product is saved.

org.neo4j.helpers.ThisShouldNotHappenError: Developer: Andres claims that: This execution plan should not exist.
at org.neo4j.cypher.internal.commands.PathExpression$$anonfun$4.apply(PathExpression.scala:47)
at org.neo4j.cypher.internal.commands.PathExpression$$anonfun$4.apply(PathExpression.scala:46)
at scala.collection.LinearSeqOptimized$class.exists(LinearSeqOptimized.scala:79)
at scala.collection.immutable.List.exists(List.scala:45)
at org.neo4j.cypher.internal.commands.PathExpression.apply(PathExpression.scala:46)
at org.neo4j.cypher.internal.commands.PathExpression.apply(PathExpression.scala:31)
at org.neo4j.cypher.internal.commands.NonEmpty.isMatch(Predicate.scala:283)
at org.neo4j.cypher.internal.commands.Not.isMatch(Predicate.scala:115)
at org.neo4j.cypher.internal.commands.And.isMatch(Predicate.scala:83)
at org.neo4j.cypher.internal.pipes.matching.FilteringIterable$FilteringIterator.spoolToNextInLine(FilteringIterable.scala:55)
at org.neo4j.cypher.internal.pipes.matching.FilteringIterable$FilteringIterator.(FilteringIterable.scala:34)
at org.neo4j.cypher.internal.pipes.matching.FilteringIterable.iterator(FilteringIterable.scala:72)
at org.neo4j.cypher.internal.pipes.matching.FilteringIterable.iterator(FilteringIterable.scala:27)
at scala.collection.JavaConversions$IterableWrapperTrait$class.iterator(JavaConversions.scala:557)
at scala.collection.JavaConversions$IterableWrapper.iterator(JavaConversions.scala:583)
at scala.collection.JavaConversions$IterableWrapper.iterator(JavaConversions.scala:583)
at org.neo4j.kernel.impl.traversal.TraversalBranchWithState.expandRelationshipsWithoutChecks(TraversalBranchWithState.java:70)
at org.neo4j.kernel.impl.traversal.TraversalBranchImpl.expandRelationships(TraversalBranchImpl.java:104)
at org.neo4j.kernel.impl.traversal.StartNodeTraversalBranch.next(StartNodeTraversalBranch.java:47)
at org.neo4j.kernel.impl.traversal.AsOneStartBranch.next(AsOneStartBranch.java:100)
at org.neo4j.kernel.PreorderDepthFirstSelector.next(PreorderDepthFirstSelector.java:52)
at org.neo4j.kernel.impl.traversal.TraverserIterator.fetchNextOrNull(TraverserIterator.java:65)
at org.neo4j.kernel.impl.traversal.TraverserIterator.fetchNextOrNull(TraverserIterator.java:34)
at org.neo4j.helpers.collection.PrefetchingIterator.hasNext(PrefetchingIterator.java:55)
at scala.collection.JavaConversions$JIteratorWrapper.hasNext(JavaConversions.scala:574)
at scala.collection.Iterator$$anon$21.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$21.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$22.hasNext(Iterator.scala:388)
at scala.collection.Iterator$$anon$19.hasNext(Iterator.scala:334)
at scala.collection.Iterator$$anon$19.hasNext(Iterator.scala:334)
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
at scala.collection.Iterator$$anon$19.foreach(Iterator.scala:333)
at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:128)
at scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:242)
at scala.collection.Iterator$$anon$19.toList(Iterator.scala:333)
at org.neo4j.cypher.internal.pipes.SortPipe.createResults(SortPipe.scala:39)
at org.neo4j.cypher.internal.pipes.ColumnFilterPipe.createResults(ColumnFilterPipe.scala:37)
at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$6.apply(ExecutionPlanImpl.scala:127)
at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$6.apply(ExecutionPlanImpl.scala:125)
at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl.execute(ExecutionPlanImpl.scala:33)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:59)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:63)
at org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:79)
at org.springframework.data.neo4j.support.query.CypherQueryEngine.parseAndExecuteQuery(CypherQueryEngine.java:61)
at org.springframework.data.neo4j.support.query.CypherQueryEngine.query(CypherQueryEngine.java:49)
at org.springframework.data.neo4j.fieldaccess.QueryFieldAccessorFactory$QueryFieldAccessor.executeQuery(QueryFieldAccessorFactory.java:105)
at org.springframework.data.neo4j.fieldaccess.QueryFieldAccessorFactory$QueryFieldAccessor.getValue(QueryFieldAccessorFactory.java:98)
at org.springframework.data.neo4j.fieldaccess.DefaultEntityState.getValue(DefaultEntityState.java:97)
at org.springframework.data.neo4j.support.mapping.SourceStateTransmitter.copyEntityStatePropertyValue(SourceStateTransmitter.java:90)
at org.springframework.data.neo4j.support.mapping.SourceStateTransmitter.access$000(SourceStateTransmitter.java:40)
at org.springframework.data.neo4j.support.mapping.SourceStateTransmitter$2.doWithAssociation(SourceStateTransmitter.java:61)
at org.springframework.data.mapping.model.BasicPersistentEntity.doWithAssociations(BasicPersistentEntity.java:207)
at org.springframework.data.neo4j.support.mapping.SourceStateTransmitter.copyPropertiesFrom(SourceStateTransmitter.java:57)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityConverterImpl.loadEntity(Neo4jEntityConverterImpl.java:100)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityConverterImpl.read(Neo4jEntityConverterImpl.java:92)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister$CachedConverter.read(Neo4jEntityPersister.java:170)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister.createEntityFromState(Neo4jEntityPersister.java:189)
at org.springframework.data.neo4j.support.Neo4jTemplate.createEntityFromState(Neo4jTemplate.java:180)
at org.springframework.data.neo4j.fieldaccess.RelationshipHelper.createEntitySetFromRelationshipEndNodes(RelationshipHelper.java:130)
at org.springframework.data.neo4j.fieldaccess.RelatedToFieldAccessor.createEntitySetFromRelationshipEndNodes(RelatedToFieldAccessor.java:86)
at org.springframework.data.neo4j.fieldaccess.RelatedToSingleFieldAccessorFactory$RelatedToSingleFieldAccessor.getValue(RelatedToSingleFieldAccessorFactory.java:76)
at org.springframework.data.neo4j.fieldaccess.DefaultEntityState.getValue(DefaultEntityState.java:97)
at org.springframework.data.neo4j.support.mapping.SourceStateTransmitter.copyEntityStatePropertyValue(SourceStateTransmitter.java:90)
at org.springframework.data.neo4j.support.mapping.SourceStateTransmitter.access$000(SourceStateTransmitter.java:40)
at org.springframework.data.neo4j.support.mapping.SourceStateTransmitter$2.doWithAssociation(SourceStateTransmitter.java:61)
at org.springframework.data.mapping.model.BasicPersistentEntity.doWithAssociations(BasicPersistentEntity.java:207)
at org.springframework.data.neo4j.support.mapping.SourceStateTransmitter.copyPropertiesFrom(SourceStateTransmitter.java:57)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityConverterImpl.loadEntity(Neo4jEntityConverterImpl.java:100)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityConverterImpl.read(Neo4jEntityConverterImpl.java:92)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister$CachedConverter.read(Neo4jEntityPersister.java:170)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister.createEntityFromState(Neo4jEntityPersister.java:189)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister.persist(Neo4jEntityPersister.java:244)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister.persist(Neo4jEntityPersister.java:231)
at org.springframework.data.neo4j.support.Neo4jTemplate.save(Neo4jTemplate.java:293)
at org.springframework.data.neo4j.support.Neo4jTemplate.save(Neo4jTemplate.java:287)
at org.springframework.data.neo4j.repository.AbstractGraphRepository.save(AbstractGraphRepository.java:108)
at libTest.DomainTest.createProduct(DomainTest.java:155)
at domainTest.entities.ProductTest.saveWithCompany(ProductTest.java:22)
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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Greetz to Andres ;-)

Michael Hunger
Collaborator

@SchulteMarkus do you have the actual SDN class that contains the @Query annotation on the field? Is it this query or something else?

START company=node({self}) 
MATCH company<-[:orderAtCompany]-orderNode 
WHERE NOT company-[:accepts|denies]->orderNode 
RETURN orderNode 
ORDER BY orderNode.created params 
{self=1}
Andres Taylor systay referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Andres Taylor systay closed this issue from a commit
Andres Taylor systay Fixes #395 - ThisShouldNotHappenError when using path expressions in …
…predicates for certain patterns
6c98037
Andres Taylor systay closed this in 6c98037
Armen

How to update node with Spring data? For example some properties changed and I want update node entity

Michael Hunger
Collaborator

Can you please post your question on stack overflow with enough context / code provided for people to answer? Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.