cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Shouldn't SaveEventDelegate#preSave take as well a depth parameter to limit the depth visit?

Hello,

org.neo4j.ogm.session.delegates.SaveDelegate#save(T, int) is taking a depth parameter but not SaveEventDelegate#preSave. The visit of the nodes can be pretty extensive. Is it on purpose?

1 ACCEPTED SOLUTION

The question seems to be incomplete but I just assume that you were asking for the unreachable() processing.

This will only be done for the up until the level the data was loaded initially.
Example with horizon on load:
A->B->C and you load only A->B remove the B from A and you do a save(A, 500) (intentionally high number), it will only process B in the unreachable list because it is the only removed relationship that "changes" (from existence to void).
Example without horizon on load:
A->B->C and you load only A->B->C remove the B from A and you do a save(A, 1), it will still only process B in the unreachable list. Even if you would remove C from B in the same run. So the dangerous this in this situation is that your graph model will diverge from your Java model.

View solution in original post

2 REPLIES 2

The question seems to be incomplete but I just assume that you were asking for the unreachable() processing.

This will only be done for the up until the level the data was loaded initially.
Example with horizon on load:
A->B->C and you load only A->B remove the B from A and you do a save(A, 500) (intentionally high number), it will only process B in the unreachable list because it is the only removed relationship that "changes" (from existence to void).
Example without horizon on load:
A->B->C and you load only A->B->C remove the B from A and you do a save(A, 1), it will still only process B in the unreachable list. Even if you would remove C from B in the same run. So the dangerous this in this situation is that your graph model will diverge from your Java model.

Thank you for your answer. I better understand the needs now.