java.lang.IllegalStateException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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}
    via by Johannes Mockenhaupt,
  • 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}
    via by Johannes Mockenhaupt,
  • GitHub comment 16#6832006
    via GitHub by ceefour
    ,
    • 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)
    No Bugmate found.