On Fri, Aug 21, 2009 at 20:58, Rodrigo Meza<[email protected]> 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

Reply via email to