Hi,

One of our engineers encountered a time-out on an LDAP connection that was not used for some time. The exception occured in org.apache.directory.ldap.client.api.SearchCursorImpl.next(SearchCursorImpl.java:149). This is not a very convenient place to throw an exception, but I can live with that. The problem is that what is thrown is literally LdapExcpetion:

throw new LdapException( LdapNetworkConnection.TIME_OUT_ERROR );

Ideally, I would like my client to transparently re-connect and re-start the operation when the connection timed-out. But there is no way for a client to detect that this was really a timeout (even the LdapNetworkConnection.TIME_OUT_ERROR is package-private).

So, obviously this needs to be fixed. My first choice was to replace that with throw new InvalidConnectionException. But on a second thought I'm not really sure about this. Is InvalidConnectionException the same situation as timeout? Wouldn't we want a new TimeOutException for this (as subclass of LdapException)? Or is there any other (e.g. Mina-based) mechanism for this?

--
Radovan Semancik
Software Architect
evolveum.com

Reply via email to