On Mon Mar 05 2007 at 17:10:53 CET, Tim Tyler wrote: > Do you use ldapsearch command and tail -1 for the next uid? Do you keep > track of the latest assigned uid in a seperate file or something and > increment the file appropriately? I am curious if there is a > recommendadtion for best practice in obtaining the next available uid? > Any advise is much appreciated!
You could search for the last and increment, but that could cause a race- condition if your program runs simultaneously (you don't want to issue duplicate uids do you?) We have created a simple objectClass which stores the highest assigned uidnumber. objectClass: uidNumberManagement highestAssignedUidNumber: 13514 What our programs then do is to search for that attribute type and do a MOD with two operations: delete the value and add an incremented value. Since the DELETE will only work if the value is still in the attribute type, we effectively have a 'transaction' which guarantees uniqueness. -JP --- You are currently subscribed to ldap@umich.edu as: [EMAIL PROTECTED] To unsubscribe send email to [EMAIL PROTECTED] with the word UNSUBSCRIBE as the SUBJECT of the message.