The deletion of entries is implemented very ineffectively in a pessemistic way: Before delting an entry a one-level search is performed to find out if there are child entries. This is done recursively. Not until an entry doesn't have any child entries the entry itself it removed. So when deleting an ou with thousands of child entries there are thousands of searches for each child entry.
We should reimplement it more optimistic:
- use the tree delete control if supported by the server
- else try to delete the entry. If receiving an error code 66 (notAllowedOnNonLeaf) then perform a one-level search and try to delete these entries.
This is a bigger change, lets postpone this issue and reimplement it together with