On Thu, Sep 3, 2009 at 10:40 AM, mitziuro<[email protected]> wrote: > In my application i need to delete all the version data of a node when the > node is deleted. > I'm getting the version history, I delete the node, then I'm trying to > delete all the versions exept the rootVersion node. > When I commit the transaction I get a ReferencialIntegrityException because > the rootVersion node is referring a deleted node. > > What is the solution in this case ?
AFAIK, deleting the root node is not possible. But with https://issues.apache.org/jira/browse/JCR-134 included in 1.6.0, an empty, orphanded version history will be deleted automatically. See the test for some sample code on that behaviour: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveOrphanVersionHistoryTest.java?revision=789701 Regards, Alex -- Alexander Klimetschek [email protected]
