Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 5826 invoked from network); 27 Aug 2009 07:24:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Aug 2009 07:24:57 -0000 Received: (qmail 8966 invoked by uid 500); 27 Aug 2009 07:24:56 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 8904 invoked by uid 500); 27 Aug 2009 07:24:56 -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 8893 invoked by uid 99); 27 Aug 2009 07:24:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Aug 2009 07:24:56 +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 mreutegg@day.com designates 207.126.148.183 as permitted sender) Received: from [207.126.148.183] (HELO eu3sys201aog003.obsmtp.com) (207.126.148.183) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 27 Aug 2009 07:24:46 +0000 Received: from source ([209.85.219.228]) by eu3sys201aob003.postini.com ([207.126.154.11]) with SMTP ID DSNKSpY0qAHWZ1KQfpz9dt38nXZkSvN7zvc0@postini.com; Thu, 27 Aug 2009 07:24:26 UTC Received: by ewy28 with SMTP id 28so1036491ewy.15 for ; Thu, 27 Aug 2009 00:24:24 -0700 (PDT) MIME-Version: 1.0 Sender: mreutegg@day.com Received: by 10.210.111.5 with SMTP id j5mr9170800ebc.32.1251357863935; Thu, 27 Aug 2009 00:24:23 -0700 (PDT) In-Reply-To: References: <25061460.post@talk.nabble.com> <510143ac0908200601t1ff85490xcfcb6cdbfc6c635a@mail.gmail.com> <25061672.post@talk.nabble.com> Date: Thu, 27 Aug 2009 09:24:23 +0200 X-Google-Sender-Auth: dac5bb840bd16ca3 Message-ID: Subject: Re: Primary property From: Marcel Reutegger 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 Fri, Aug 21, 2009 at 20:58, Rodrigo Meza wrote: > I have the same problem that Brice_ has, and the solution I came up with was > to query the repository for another node with the same property before > adding a new one. Is there any practical problem with this approach I am not > aware of? concurrency. you may end up with two sessions that execute the query and add a node with the same name at the same time. if uniqueness must be guaranteed you should run the code while it hold a lock on a node. there's a utility class that can help you: http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/util/Locked.html regards marcel