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

RE: How can I lock a record using php-ldap?

As has already been pointed out, this sem_get() approach only works if all of
your operations come from the same machine. Since the purpose of using an
LDAP directory is to provide distributed access to information, this solution
really isn't appropriate in the general case.

Once again - learn how to use the LDAP Modify operation. When you delete/add
a value atomically, this is semantically the same as acquiring a mutex. From
that mutex operation you can build whatever other synchronization primitive
you wish.

re: attribute rewrite overhead, indexing overhead - obviously you can
completely avoid the indexing overhead by storing your values in a
non-indexed attribute. Also, OpenLDAP 2.1's back-bdb is far more efficient in
re-indexing modified entries, so there's not too much impact there even if
you use an indexed attribute.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support

> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Jim C

> <the lights come on>

> Mike O'Rourke wrote:
> > You could use the sem_get(), sem_acquire() and
> sem_release() functions