No description, website, or topics provided.
Java
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/main
.gitignore
README
pom.xml

README

Example project to demonstrate a bug (?) with Spring Data Neo4j.

If a new relationship is persisted within a transaction, then the transaction is rolled back, the persistent state is not cleared.

Run with
	mvn clean compile exec:java
and receive the exception:
	org.neo4j.graphdb.NotFoundException: Relationship[1] not found.
		at org.neo4j.kernel.impl.core.NodeManager.getRelationshipForProxy(NodeManager.java:561) ~[neo4j-kernel-1.8.1.jar:1.8.1]
		at org.neo4j.kernel.InternalAbstractGraphDatabase$3.lookupRelationship(InternalAbstractGraphDatabase.java:633) ~[neo4j-kernel-1.8.1.jar:1.8.1]
		at org.neo4j.kernel.impl.core.RelationshipProxy.setProperty(RelationshipProxy.java:129) ~[neo4j-kernel-1.8.1.jar:1.8.1]
		at org.springframework.data.neo4j.fieldaccess.PropertyFieldAccessorFactory$PropertyFieldAccessor.setValue(PropertyFieldAccessorFactory.java:73) ~[spring-data-neo4j-2.2.0.RELEASE.jar:na]
		at org.springframework.data.neo4j.fieldaccess.DefaultEntityState.setValue(DefaultEntityState.java:113) ~[spring-data-neo4j-2.2.0.RELEASE.jar:na]
		at org.springframework.data.neo4j.fieldaccess.DetachedEntityState.setValue(DetachedEntityState.java:158) ~[spring-data-neo4j-2.2.0.RELEASE.jar:na]
		at org.springframework.data.neo4j.fieldaccess.DetachedEntityState.setValue(DetachedEntityState.java:137) ~[spring-data-neo4j-2.2.0.RELEASE.jar:na]
		at matt.graph.SimpleChildOf.flag_aroundBody17$advice(SimpleChildOf.java:176) ~[classes/:na]
		at matt.graph.SimpleChildOf.setFlag(SimpleChildOf.java:46) ~[classes/:na]
		at matt.graphrepo.NameService.addNewRelationships(NameService.java:52) ~[classes/:na]
		at matt.app.TestController$1.doInTransactionWithoutResult(TestController.java:42) ~[classes/:na]
		at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) ~[spring-tx-3.2.1.RELEASE.jar:3.2.1.RELEASE]
		at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131) ~[spring-tx-3.2.1.RELEASE.jar:3.2.1.RELEASE]
		at matt.app.TestController.change(TestController.java:37) [classes/:na]
		at matt.app.App.main(App.java:88) [classes/:na]
		at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_09]
		at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_09]
		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_09]
		at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_09]
		at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297) [exec-maven-plugin-1.2.1.jar:na]
		at java.lang.Thread.run(Thread.java:722) [na:1.7.0_09]

Uncomment the line
	//cToA.setPersistentState(null);
in App.java and the problem is 'fixed'.