Overview#There are typically a few common issues where connection could be lost from a LDAP connection.
Loss of LDAP Directory System Agent#Loss of LDAP Server either to failure or routine maintenance can typically be overcome by utilizing a connection pool.
Normally, the connection pool will maintain several LDAP connections and ensure they are valid.
TCP Disconnects#Often in LOAD Balanced LDAP environments we have seen incidents where the Load Balancer will sever TCP Sessions upon which there is no traffic within a defined period. As the Load balancer is a "Man-In-The-Middle" TCP entities, they may simply close the TCP Sessions without an proper disconnect. LDAP pool will minimize the severed TCP sessions as the pool will monitor and send a type of "keep-alive" packet to the LDAP servers.
If the application can be programmed to verify the TCP session before sending a new LDAP request is always best. Some LDAP APIs will provide a isConnected() method to verify if the LDAP session is still alive.