last day (14 days later) » 

3:44 PM
0
Q: Neo4j Error: Node xxx has already been deleted in this transaction

AqqqqIt seems that this cypher code would cause this error: Node xxx has already been deleted in this transaction. MATCH (a:Address), (b:Address), (a)-[r:BelongTo]->(:Wallet), (b)-[:BelongTo]->(:Wallet) WHERE a.AddId=b.AddId AND ID(a) > ID(b) WITH r, a, b, a {.*, rel: r {.*, type:type(r)}} as snapsh...

 
Can you show example data? P.S. If you want delete node and their relationships you can use DETACH DELETE a.
 
@stdob-- I am aware of DETACH DELETE, but I would prefer not to use ito for now as I am not sure if the other part of my query is working properly. As for example data, as there is a large amount of data involved, so it would be difficult. I could give you the whole code if you want though. (It is a java program which run the cypher code.)
I can also send you the csv files which triggered this error if you want. (my cypher code load data from csv files first.)
I am aware of that. But as I said, it is difficult due to the massive data involved. I just figured out a way to get some relevant data, which is the data of three nodes (two of them is the ones in concern here. I don't know which two.)
 
Can you show an example of data as a cypher to add them?
 
Do you mean the format of the data in csv files?
 
No, as cypher query with create or merge this 3 nodes and relationships.
 
3:44 PM
Do you want the details of the way the properties are set as well?
 
Respecting someone else's time, you need to show an example of data with the easiest way to add them for debugging. For example, it can be a short cypher query that adds the necessary nodes and links. And on these inputs, your original query should show the error that you are asking to help fix.
 
Done.
 
OK I will get rid of the property setting part. The thing is, sometimes the problem could have lie in the property setting.
I think I am done.
I think the problem is due to the fact that there are three nodes present. Is there a way to make sure that, for example, a always have the minimum ID?
* The smallest ID number of the three
 
4:02 PM
Sorry, but it did not become easier. I can not add test data.
What you mean by "Is there a way to make sure that, for example, a always have the minimum ID?"
 
Since there are three Address nodes involved in the MATCH, let's call them a, b, c. Assuming that in terms of ID number, a >b>c. Then We will have three rows of matches:
a b
b c
a c
When the query goes through these three rows in that order and delete for example a, then when the query arrive at a c row, the a would have been deleted. I think this is the reason for the error.
But thinking back on that, making a having the minimum ID does not make it simpler though.
Maybe updating the match result every time a node is deleted or newly created in the body of the query would help. Is it possible with cypher?
(The reason why making a having the minimum ID does not help is due to the fact that the a will also be deleted. (During each round, both nodes in the row in concern are deleted.))
 
 
2 hours later…
6:02 PM
I just realized that such error is due to the fact that queries are carried out too fast.
I will answer the question.
 

last day (14 days later) »