java.lang.IllegalStateException: Unable to delete relationship[255491] since it is already deleted.

Spring JIRA | Johannes Mockenhaupt | 3 years ago
  1. 0

    The implementation of _CRUDRepository.deleteAll()_ employs _EntityRemover.removeNode()_, which deletes all relationships regardless of direction. Thus, each relationship is deleted from the start and the end node, which is invalid and throws (sample below). {code} Exception in thread "main" java.lang.IllegalStateException: Unable to delete relationship[255491] since it is already deleted. at org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.relDelete(WriteTransaction.java:668) at org.neo4j.kernel.impl.persistence.PersistenceManager.relDelete(PersistenceManager.java:171) at org.neo4j.kernel.impl.core.NodeManager.deleteRelationship(NodeManager.java:1102) at org.neo4j.kernel.impl.core.RelationshipImpl.delete(RelationshipImpl.java:138) at org.neo4j.kernel.impl.core.RelationshipProxy.delete(RelationshipProxy.java:62) at org.springframework.data.neo4j.support.DelegatingGraphDatabase.remove(DelegatingGraphDatabase.java:253) at org.springframework.data.neo4j.support.mapping.EntityRemover.removeRelationship(EntityRemover.java:64) at org.springframework.data.neo4j.support.mapping.EntityRemover.removeNode(EntityRemover.java:51) at org.springframework.data.neo4j.support.mapping.EntityRemover.removeNodeEntity(EntityRemover.java:45) at org.springframework.data.neo4j.support.mapping.EntityRemover.remove(EntityRemover.java:85) at org.springframework.data.neo4j.support.Neo4jTemplate.delete(Neo4jTemplate.java:222) at org.springframework.data.neo4j.repository.AbstractGraphRepository.delete(AbstractGraphRepository.java:328) at org.springframework.data.neo4j.repository.AbstractGraphRepository.delete(AbstractGraphRepository.java:339) at org.springframework.data.neo4j.repository.AbstractGraphRepository.deleteAll(AbstractGraphRepository.java:345) 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:606) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:333) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy34.deleteAll(Unknown Source) {code}

    Spring JIRA | 3 years ago | Johannes Mockenhaupt
    java.lang.IllegalStateException: Unable to delete relationship[255491] since it is already deleted.
  2. 0

    The implementation of _CRUDRepository.deleteAll()_ employs _EntityRemover.removeNode()_, which deletes all relationships regardless of direction. Thus, each relationship is deleted from the start and the end node, which is invalid and throws (sample below). {code} Exception in thread "main" java.lang.IllegalStateException: Unable to delete relationship[255491] since it is already deleted. at org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.relDelete(WriteTransaction.java:668) at org.neo4j.kernel.impl.persistence.PersistenceManager.relDelete(PersistenceManager.java:171) at org.neo4j.kernel.impl.core.NodeManager.deleteRelationship(NodeManager.java:1102) at org.neo4j.kernel.impl.core.RelationshipImpl.delete(RelationshipImpl.java:138) at org.neo4j.kernel.impl.core.RelationshipProxy.delete(RelationshipProxy.java:62) at org.springframework.data.neo4j.support.DelegatingGraphDatabase.remove(DelegatingGraphDatabase.java:253) at org.springframework.data.neo4j.support.mapping.EntityRemover.removeRelationship(EntityRemover.java:64) at org.springframework.data.neo4j.support.mapping.EntityRemover.removeNode(EntityRemover.java:51) at org.springframework.data.neo4j.support.mapping.EntityRemover.removeNodeEntity(EntityRemover.java:45) at org.springframework.data.neo4j.support.mapping.EntityRemover.remove(EntityRemover.java:85) at org.springframework.data.neo4j.support.Neo4jTemplate.delete(Neo4jTemplate.java:222) at org.springframework.data.neo4j.repository.AbstractGraphRepository.delete(AbstractGraphRepository.java:328) at org.springframework.data.neo4j.repository.AbstractGraphRepository.delete(AbstractGraphRepository.java:339) at org.springframework.data.neo4j.repository.AbstractGraphRepository.deleteAll(AbstractGraphRepository.java:345) 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:606) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:333) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy34.deleteAll(Unknown Source) {code}

    Spring JIRA | 3 years ago | Johannes Mockenhaupt
    java.lang.IllegalStateException: Unable to delete relationship[255491] since it is already deleted.
  3. 0

    py2neo error on write batch py2neo.neo4j.BatchOperationFailedException

    Stack Overflow | 3 years ago | skme
    java.lang.IllegalStateException: Unable to delete relationship[259221] since it is already deleted.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    GitHub comment 16#6832006

    GitHub | 4 years ago | ceefour
    java.lang.IllegalStateException: Unable to delete relationship[16] since it is already deleted.
  6. 0

    Duplicate Relationships on creation of a related node

    GitHub | 3 months ago | ryancollingwood
    java.lang.IllegalStateException: Unable to delete relationship[3521] since it is already deleted.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Unable to delete relationship[255491] since it is already deleted.

      at org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.relDelete()
    2. org.neo4j.kernel
      PersistenceManager.relDelete
      1. org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.relDelete(WriteTransaction.java:668)
      2. org.neo4j.kernel.impl.persistence.PersistenceManager.relDelete(PersistenceManager.java:171)
      2 frames
    3. Neo4j - Graph Database Kernel
      RelationshipProxy.delete
      1. org.neo4j.kernel.impl.core.NodeManager.deleteRelationship(NodeManager.java:1102)
      2. org.neo4j.kernel.impl.core.RelationshipImpl.delete(RelationshipImpl.java:138)
      3. org.neo4j.kernel.impl.core.RelationshipProxy.delete(RelationshipProxy.java:62)
      3 frames
    4. Spring Data Neo4j
      AbstractGraphRepository.deleteAll
      1. org.springframework.data.neo4j.support.DelegatingGraphDatabase.remove(DelegatingGraphDatabase.java:253)
      2. org.springframework.data.neo4j.support.mapping.EntityRemover.removeRelationship(EntityRemover.java:64)
      3. org.springframework.data.neo4j.support.mapping.EntityRemover.removeNode(EntityRemover.java:51)
      4. org.springframework.data.neo4j.support.mapping.EntityRemover.removeNodeEntity(EntityRemover.java:45)
      5. org.springframework.data.neo4j.support.mapping.EntityRemover.remove(EntityRemover.java:85)
      6. org.springframework.data.neo4j.support.Neo4jTemplate.delete(Neo4jTemplate.java:222)
      7. org.springframework.data.neo4j.repository.AbstractGraphRepository.delete(AbstractGraphRepository.java:328)
      8. org.springframework.data.neo4j.repository.AbstractGraphRepository.delete(AbstractGraphRepository.java:339)
      9. org.springframework.data.neo4j.repository.AbstractGraphRepository.deleteAll(AbstractGraphRepository.java:345)
      9 frames
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    6. Spring Data Core
      RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke
      1. org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:333)
      2. org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:318)
      2 frames
    7. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      1 frame
    8. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
      2. org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
      3. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
      3 frames
    9. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      1 frame
    10. Spring Tx
      PersistenceExceptionTranslationInterceptor.invoke
      1. org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
      1 frame
    11. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      2 frames
    12. com.sun.proxy
      $Proxy34.deleteAll
      1. com.sun.proxy.$Proxy34.deleteAll(Unknown Source)
      1 frame