spring-ldap
spring-ldap copied to clipboard
Data loss when update() results in NameAlreadyBoundException
trafficstars
I'm attempting to rename an entry as part of the LdapTemplate.update() call. That method includes support for this: it checks if the ID has changed, and will call an unbind() and rebind() if necessary to handle the rename.
The issue occurs when the new ID is already in use: we get the expected NameAlreadyBoundException, but the entry has now ceased to exist. Since unbind() has been called, but bind() fails, the entry is gone.