[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Locking an OpenLDAP directory for atomic operations



A common way of handling such issues is to use an entry (or attribute
of an entry) as an advisory lock.  As in the link you reference, this
can be implemented using whatever language you choose.  I don't
see a particular need for a convenience API, one can simply use
the API's modify API here.  So, no, JLDAP does not provide a
particular "locking" API, but it certainly provides a modify API.

There is not yet a standardized test-and-set mechanism, though I
am working on getting mechanisms (e.g., the assertion control,
the pre-/post-read controls, and the modify/increment feature)
implemented in OpenLDAP HEAD onto the standards track.  I suspect
that APIs will be updated to provide APIs for some or all of these
features (modify/increment, in fact, will require specific API
support).  Those interested in contributing such are encouraged
to do so.

Kurt

At 01:45 PM 11/29/2004, Ali Safdar Kureishy wrote:
>Hi,
>
>I have one client accessing my OpenLDAP server for read (and
>potentially write) access while I have another client that
>periodically triggers an LDIF import into the server using a
>periodically generated LDIF file. I want to be able to lock the
>directory for either operation so as to prevent any dirty reads by the
>first client, or any overlapping writes by both.
>
>I noticed a message posted here a long time ago about implementing a
>locking mechanism using a test-and-set operation on some OpenLDAP
>entry.
>(http://www.openldap.org/lists/openldap-software/200009/msg00559.html)
>
>Since this is a pretty old post, I was wondering if there is a
>programmatic way for me to achieve this in a simpler way now...
>
>If not, is there such a test-and-set primitive available in OpenLDAP?
>Can it be invoked using JNDI or JLDAP? (I didn't quite understand the
>approach Kurt posted about the test-and-set operation in the link
>above). Any details would be greatly appreciated. :)
>
>Thanks in advance!
>
>Safdar