directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Radovan Semancik <>
Subject Error handling: cursor time out
Date Mon, 09 May 2016 14:19:55 GMT

One of our engineers encountered a time-out on an LDAP connection that 
was not used for some time. The exception occured in 
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 

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

View raw message