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

RE: Auto-Increment



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

> Robert Canary wrote:
> > Is it possible to create an auto-incrementing field in LDAP?  I would
> > like to use it in my uidNumber field from the accoun schema.
> >
> > It would certain be a wonderfull feature, IMHO.
>
> As somebody already said, it isn't supported in OpenLDAP, but it can be
> accomplished at your application layer. I just released code that does
> exactly this with an OpenLDAP based weblog application:
>
> http://www.mentata.com/ldaphttp/examples/gospel/jesusblog.htm

While I find your project fascinating, I should point out that I and others
have posted the uidNumber/unique ID solution to this list multiple times
already. A simple search on "uidNumber" in the archive will turn up the
answer explicitly; reading RFC2251 "LDAP Modify" will give you the background
for what is being done. I have reposted the URLs for the relevant posts so
many times now, I'm just going to leave this as an exercise for the reader.

Locking a value in memory that is dependent on values in the directory is not
a real solution. You have to work within the directory itself if you really
want a guarantee of uniqueness, or ensure that your single process is the
only avenue of entry to the directory. I guess for your project, the latter
is true, so no big deal, but then you've essentially turned a system designed
for distributed access into a monolithic embedded database, and if that's all
you wanted in the first place, there's more direct ways to do that.

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