Hi all,
thinking about using this library in my project instead of my personal "LDAPManager" class that I've used for years, but I noticed one case which I'm not sure is handled.
Since the LdapTemplate class is a singleton, the initialization of the connection to the ldap server happens only once upon startup. Perfect.
The problem: in a clustered production environment where web apps run uninterrupted for weeks or months at a time, it occasionally happens that the naming server goes down temporarily for whatever reason (network problems, registry server problems, etc). At this point, the original connection is ruined and all calls to ldap return a "CommunicationException: Connection reset by peer". The only way to recover is to restart the web app in order to re-establish the connection.
The question: any plan to handle this elegantly and try to re-establish the connection before throwing the exception? I quickly glanced through the source code and saw that the CommunicationException is simply mapped to a "DataRetrievalFailureException: Unable to communicate with LDAP server", but this unfortunately doesn't resolve the problem of restarting the app, which is a huge pain :-((
Did I miss something or is this right? If so, any chance of implementing the change?


Reply With Quote
