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

Re: Faster updates

Martin Smith wrote:

Given that, I've coded an update program that:
(1) builds a "temporg" subtree in my directory from each new data file (including required parents.)
(2) for each entry in this tree, looks for a matching entry in the "permanent" tree. If not found, then add entry (and parent(s) if required.)
(3) If found, but attributes don.t match (! oldBasicAttributes.equals(newBasicAttributes)), replace old attributes.
(4) Then, recursing through the permanent subtree for the updating org, look for a matching entry in the temp tree. If not match, then delete the entry (children first, taking advantage of the recursive approach of this method.)
(5) Finally, delete the temp subtree.

Works great (mostly <g>), but takes approximately forever.

It depends very much on your directory design. But IMHO there is much potential for optimization since this process looks complicated to me. At first I would think about whether it's really necessary to build a "temporg" subtree.

Also, can I assume that slapadd is LOTS faster than using the JNDI API?

slapadd works directly on the DB files. There is no LDAP access involved.

Ciao, Michael.