Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 93113 invoked from network); 21 Jul 2009 19:11:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Jul 2009 19:11:36 -0000 Received: (qmail 74265 invoked by uid 500); 21 Jul 2009 19:12:41 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 74228 invoked by uid 500); 21 Jul 2009 19:12:41 -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 74217 invoked by uid 99); 21 Jul 2009 19:12:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2009 19:12:41 +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.181 as permitted sender) Received: from [207.126.148.181] (HELO eu3sys201aog001.obsmtp.com) (207.126.148.181) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 21 Jul 2009 19:12:29 +0000 Received: from source ([209.85.219.222]) by eu3sys201aob001.postini.com ([207.126.154.11]) with SMTP ID DSNKSmYTBqapOw930tTCxegTCyxbOE3kySS6@postini.com; Tue, 21 Jul 2009 19:12:08 UTC Received: by ewy22 with SMTP id 22so1555099ewy.46 for ; Tue, 21 Jul 2009 12:12:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.7.67 with SMTP id 45mr3478weo.95.1248203526539; Tue, 21 Jul 2009 12:12:06 -0700 (PDT) In-Reply-To: References: <24560696.post@talk.nabble.com> Date: Tue, 21 Jul 2009 21:12:06 +0200 Message-ID: Subject: Re: API to cleanup dangling reference? From: Alexander Klimetschek To: users@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Jul 21, 2009 at 8:42 PM, Khanapurkar, Mona A. wrote: > Does Jackrabbit have an API to cleanup dangling references? If you are talking about REFERENCE properties, it is impossible to have dangling references right within the JCR API, because you cannot remove a node that is still being pointed at. See the javadoc of the Item.remove() method [1]: A ReferentialIntegrityException will be thrown on save if this item or an item in its subtree is currently the target of a REFERENCE property located in this workspace but outside this item's subtree and the current Session has read access to that REFERENCE property. If you use STRING or PATH properties as ("weak") references, the best way to check for them is by running an xpath search: //*[@referenceProp='/dangling/path'] [1] http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/Item.html#remove() Regards, Alex -- Alexander Klimetschek alexander.klimetschek@day.com