Yes, this will work. The delete operation is really just a "mark for
removal" operation, they still be reachable until the transaction is
finished(), this is to enable things exactly like the scenario you are
describing.

On Mon, Mar 15, 2010 at 3:10 PM, Erik Ask <[email protected]> wrote:

> Hello
>
> Im going to delete a node with subnodes and all relationships. I've
> written a traversal that given the mian node to delete collects all its
> relevant subnodes. But I'm not sure whats going to happen when i start
> deleting stuff. This is best explained by example
>
> node1
>  > node2
>  > node3
>      ->node4
>      ->node5
>  > node6
>
> I have a traverser that goes through relationships > and ->, so I'll
> find all nodes. My isreturn... is all but start node, so this traverser
> gives node2-6.
>
> what i want to do is
> for node in trav(node1):
>    for rel in relationships():
>       del rel
>    del node
>
> (i actually still need this so it can't go in the loop)
> for rel in node 1:
>    delete rel
> del node1
>
> Will the above code break my traverser? if i delete all relationships
> when node 3 is returned, will it miss node4-5? If i delete node3, find
> node 4 delete that, can it go back to the nonexistent node3 to find node
> 5? Also. will the traverser add hidden relationships/connections that
> prevents node removal?? Is this simply solved by the transaction begin,
> success, finish statements. i.e delete commands are set for all, but not
> executed until tx.finish/success??
>
> /Erik Ask
> _______________________________________________
> Neo mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Tobias Ivarsson <[email protected]>
Hacker, Neo Technology
www.neotechnology.com
Cellphone: +46 706 534857
_______________________________________________
Neo mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to