Announcement Announcement Module
No announcement yet.
Persistent state of a relationship after transaction rollback Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Persistent state of a relationship after transaction rollback

    I think this may be related to this bug, but for relationships rather than nodes. Alternatively, I might be doing something stupid.

    If I make a new relationship, persist it, but roll back the transaction, the relationship still has persistent state. If I then try and persist it again, I get the exception "org.neo4j.graphdb.NotFoundException: Relationship[1] not found."

    Clone for an example.

    Selected lines from a log:
    17:58:04.867 INFO - →→→ Dumping repository (before)
    17:58:04.880 WARN  matt.graphrepo.NameService - ▻►► SHOWING GRAPH ◄◄◅
    17:58:05.470 WARN  matt.graphrepo.NameService - (1 a)
    17:58:05.473 WARN  matt.graphrepo.NameService - (2 b)►b↗a (Matt)►(1 a)
    17:58:05.474 WARN  matt.graphrepo.NameService - (3 c)
    17:58:05.474 WARN  matt.graphrepo.NameService - ▻►► END OF GRAPH ◄◄◅
    17:58:05.474 INFO - →→→ Performing transactional change (with rollback)
    17:58:05.477 INFO - C→A's entity state [email protected]a224c4
    17:58:05.477 INFO - C→A's persistent state null
    17:58:05.477 INFO - C→A's has persistent state false
    17:58:05.481 DEBUG o.s.t.jta.JtaTransactionManager - Transactional code has requested rollback
    17:58:05.482 ERROR - C→A has persistent state, but wasn't persisted.
    17:58:05.482 INFO - C→A's entity state [email protected]a224c4
    17:58:05.482 INFO - C→A's persistent state Relationship[1]
    17:58:05.482 INFO - C→A's has persistent state true
    17:58:05.619 INFO - →→→ Performing transactional change (successfully)
    17:58:05.621 TRACE o.s.t.a.AnnotationTransactionAspect - Completing transaction for [matt.graphrepo.NameService.addNewRelationships] after exception: org.neo4j.graphdb.NotFoundException: Relationship[1] not found.
    17:58:05.627 DEBUG - Initiating transaction rollback on application exception
    org.neo4j.graphdb.NotFoundException: Relationship[1] not found.
            at org.neo4j.kernel.impl.core.NodeManager.getRelationshipForProxy( ~[neo4j-kernel-1.8.1.jar:1.8.1]
            at org.neo4j.kernel.InternalAbstractGraphDatabase$3.lookupRelationship( ~[neo4j-kernel-1.8.1.jar:1.8.1]
            at org.neo4j.kernel.impl.core.RelationshipProxy.setProperty( ~[neo4j-kernel-1.8.1.jar:1.8.1]
            at$PropertyFieldAccessor.setValue( ~[spring-data-neo4j-2.2.0.RELEASE.jar:na]
            at ~[spring-data-neo4j-2.2.0.RELEASE.jar:na]
            at ~[spring-data-neo4j-2.2.0.RELEASE.jar:na]
            at ~[spring-data-neo4j-2.2.0.RELEASE.jar:na]
            at matt.graph.SimpleChildOf.flag_aroundBody17$advice( ~[classes/:na]
            at matt.graph.SimpleChildOf.setFlag( ~[classes/:na]
            at matt.graphrepo.NameService.addNewRelationships( ~[classes/:na]
            at$1.doInTransactionWithoutResult( ~[classes/:na]
            at ~[spring-tx-3.2.1.RELEASE.jar:3.2.1.RELEASE]
            at ~[spring-tx-3.2.1.RELEASE.jar:3.2.1.RELEASE]
            at [classes/:na]
            at [classes/:na]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_09]
            at sun.reflect.NativeMethodAccessorImpl.invoke( ~[na:1.7.0_09]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[na:1.7.0_09]
            at java.lang.reflect.Method.invoke( ~[na:1.7.0_09]
            at org.codehaus.mojo.exec.ExecJavaMojo$ [exec-maven-plugin-1.2.1.jar:na]
            at [na:1.7.0_09]