OK, I've found out what happened. It's a longish story, but I'll cut it
short.
Part1: I've optimised BDB a bit, writes got much faster and the script
worked OK (both cases).
Part 2: I slowed down the BDB again for testing, and added the ->code &&
->error part
To my surprise script worked OK again (both cases).
It took ma a while, but now I know why:
1) At first, the script woudl exit before all deletes were completed. I
presume this sends "break" to ldap server, so the deletes were discarded.
2) With faster writes this wasn't visible anymore.
3) ->code added a BLOCKING line to the script, and thus the script
couldn't exit before all the deletes were finished.
Nice one. :-)
cheers
Denis