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

RE: Distinguished Name!!! [Counter question]

Thanx a lot for that guiding start!!! But don't u think that it will be at
times impossible to avoid the case that I mentioned? Lets say in case of
storing invoices we need to generate uniquie invoice Ids. And lets say when
complain is launch on a particular invoice
The search filter is so simple and retrieval will be very fast [search
filter something like '(myinvoiceid=1002, mycompanyid=101, dc=example,

Same way if say for if company name is not unique then???

I am afraid I don't know abt. using 'index hash of initial DN' as u
mentioned in ur reply to my last mail!!! Can u pls. throw some light onto it
and give a link to where I can find something in detail abt. using it!!!

Thanx a lot for the help!!!
Ravi Mittal

-----Original Message-----
From: owner-openldap-software@OpenLDAP.org
[mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Thornton Prime
Sent: Tuesday, September 19, 2000 10:12 AM
To: Ravi Mittal
Cc: openldap-software@OpenLDAP.org
Subject: Re: Distinguished Name!!!

I fear answering this question because, while I think there is a solution,
the question is one of those "How do I fit a square peg into a round
hole?" questions. Automatically generated unique IDs (like sequences in
Oracle or IDENTITY in Sybase/MS-SQL) is something you typically find in
relational databases and not in LDAP servers. The unique identifiers are
used for referential integrity and indexes required by relational
databases, and not typically used in directory-based or network-based
database structures.

It is possible to get the highest ID, but it is not easy. Pretty much your
best bet is to retrieve all the values, and iterate through them to get
the highest ID. You can't lock or reserve an ID, so if someone else
inserts the same ID while you are building your structure to add it, you
won't have unique values.

There are a number of ways around the problem. All of them will be based
on good directory server planning and application design. We often use an
indexed hash of the initial DN as a unique identifier. In cases where we
have applications relying on relational and LDAP data, we let the
relational database generate the unique identifier before we insert it
into LDAP.

thornton Prime

On Tue, 19 Sep 2000, Ravi Mittal wrote:

> Hi All,
>     I am  a database programmer switched to LDAP for this particular
> project. I want to ask u all that -
> How do I generate unique compid for copany information. The ID for all new
> entries should be generated by computer!!!
> When a new entry is inserted the program should get the last compid
> (highest) and add 1. This should be the new compid for the new entry to be
> made???
> Can any1 kindly tell me how to get the Highest/Last Compid from the LDAP
> Database
> Regards
> Ravi Mittal