Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 48025 invoked from network); 3 Jul 2008 20:14:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jul 2008 20:14:22 -0000 Received: (qmail 42856 invoked by uid 500); 3 Jul 2008 20:14:22 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 42842 invoked by uid 500); 3 Jul 2008 20:14:22 -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 42831 invoked by uid 99); 3 Jul 2008 20:14:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2008 13:14:22 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tripod@day.com designates 62.192.10.254 as permitted sender) Received: from [62.192.10.254] (HELO goobak01.day.com) (62.192.10.254) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2008 20:13:30 +0000 Received: by goobak01.day.com (Postfix, from userid 1212) id 9CB1650820; Thu, 3 Jul 2008 22:13:30 +0200 (CEST) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.30]) by goobak01.day.com (Postfix) with ESMTP id 3740C5081D for ; Thu, 3 Jul 2008 22:13:30 +0200 (CEST) Received: by yw-out-2324.google.com with SMTP id 3so544385ywj.31 for ; Thu, 03 Jul 2008 13:13:30 -0700 (PDT) Received: by 10.114.161.11 with SMTP id j11mr1466536wae.105.1215115992109; Thu, 03 Jul 2008 13:13:12 -0700 (PDT) Received: by 10.114.254.12 with HTTP; Thu, 3 Jul 2008 13:13:11 -0700 (PDT) Message-ID: Date: Thu, 3 Jul 2008 22:13:11 +0200 From: "Tobias Bocanegra" Sender: tripod@day.com To: users@jackrabbit.apache.org Subject: Re: Delete References Problem In-Reply-To: <272c2bf60807031248r639e4aa1gbd2252dd197ebb90@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <272c2bf60807031248r639e4aa1gbd2252dd197ebb90@mail.gmail.com> X-Google-Sender-Auth: 15944c116e9ca13e X-Virus-Checked: Checked by ClamAV on apache.org use: Node.getReferences() to find are properties that refer to this file. regards, toby On 7/3/08, Nick Stuart wrote: > I dont know if this is really an issue or not, but reading the API and the > current behavior I think something is mixed. > > Fairly simple use case. I have a nt:linkedFile somewhere, and I try to > delete the original file (or nt:folder containing the file) and i get > a ReferentialIntegrityException. Looking at the JCR API ofr Item.remove() it > says it will only through this exception if I have READONLY access to the > item AND the item is outside the subtree. In my case the Item is outside the > subtree, but I believe I have read/write access to the linked item. > > Is there a 'good' way to accomplish what I want? I'm thinking I have to loop > through all the sub nt:folders and files and get their REFERENCE properties > and remove those. Kind of a pain, but not horrible. Is there a way to do > this automatically? > > The full exception I am getting is this: > > Caused by: javax.jcr.ReferentialIntegrityException: > 05ad7f33-336a-40b0-bc19-8ded288c89b6: the node cannot be removed because it > is still being referenced. > at > org.apache.jackrabbit.core.state.SharedItemStateManager.checkReferentialIntegrity(SharedItemStateManager.java:1431) > at > org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:565) > at > org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:852) > at > org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:882) > at > org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:334) > at > org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:337) > at > org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:310) > at > org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:313) > at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1102) > at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:839) > > Thanks for the help and any extra info! > > > -Nick >