Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 97001 invoked from network); 3 Sep 2009 08:52:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Sep 2009 08:52:28 -0000 Received: (qmail 82446 invoked by uid 500); 3 Sep 2009 08:52:28 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 82389 invoked by uid 500); 3 Sep 2009 08:52:27 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 82378 invoked by uid 99); 3 Sep 2009 08:52:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Sep 2009 08:52:27 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aklimets@day.com designates 207.126.148.182 as permitted sender) Received: from [207.126.148.182] (HELO eu3sys201aog002.obsmtp.com) (207.126.148.182) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 03 Sep 2009 08:52:17 +0000 Received: from source ([209.85.220.224]) by eu3sys201aob002.postini.com ([207.126.154.11]) with SMTP ID DSNKSp+Dq7r4a6ES4356xuIC4Rv73yZlWvVo@postini.com; Thu, 03 Sep 2009 08:51:57 UTC Received: by fxm24 with SMTP id 24so68968fxm.12 for ; Thu, 03 Sep 2009 01:51:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.56.154 with SMTP id y26mr3786179fag.78.1251967915505; Thu, 03 Sep 2009 01:51:55 -0700 (PDT) In-Reply-To: <2bc800bc0909030140x400084f2w3c937c677533a343@mail.gmail.com> References: <2bc800bc0909030140x400084f2w3c937c677533a343@mail.gmail.com> Date: Thu, 3 Sep 2009 10:51:55 +0200 Message-ID: Subject: Re: Delete problem From: Alexander Klimetschek To: users@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Sep 3, 2009 at 10:40 AM, mitziuro 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 alexander.klimetschek@day.com