On Thu, Sep 17, 2009 at 16:44, herbert <[email protected]> wrote: > I iterate over a collection of nodes. After the first iteration has > completed, testNode references to the second node in NodeIterator and I get > an InvalidItemStateException "the item does not exist anymore" when > testNode.getName() is executed. > > Where is my error? (full code and exception appended.)
Since you query the whole repository, ie. iterate over all nodes, you might be deleting first a node that is a parent of the second one (because removal deletes the whole subtree as well). In this case you get an InvalidItemStateEx, as the Node object is still there but points to a node that no longer exists (in the transient space). Regards, Alex -- Alexander Klimetschek [email protected]
