jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Primary property
Date Thu, 27 Aug 2009 07:24:23 GMT
On Fri, Aug 21, 2009 at 20:58, Rodrigo Meza<rodrigo.meza.forms@gmail.com> 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

Mime
View raw message