Hello,
we are building a service using Apache Directory LDAP API. It should be a long running service so it should manage the LDAP connection properly to avoid disconnects or other issues after being up for a long time. The code we are using looks roughly like this Initialization: LdapConnectionConfig config = new LdapConnectionConfig() config.setLdapHost(...) config.setLdapPort(...) config.setName(...) config.setCredentials(...) connectionPool = new LdapConnectionPool(new PoolableLdapConnectionFactory(config)) connectionPool.setTestOnBorrow(true) connectionPool.setTestOnReturn(true) On each request LdapConnection connection = connectionPool.getConnection() connection.setTimeOut(...) ... //Do search/add/delete/modify using the connection connectionPool.releaseConnection(connection) We are currently trying to troubleshoot the service. Everything works fine, but after some time the service logs error similar to the below and stops working. Restart of the service fixes the issue. Therefore we suspect the long running nature of the service and we believe we may be using the connection pool incorrectly (e.g. not releasing the connection correctly) ERROR[ForkJoinPool-2-worker-3] PoolableLdapConnectionFactory - unable to unbind connection: Cannot connect on the server, the connection is invalid Unfortunately it is difficult to find documentation or examples of proper usage of connection pool. Are we using it right or are we missing some steps (e.g. bind, unbind, connect, ..?). Are there any examples or documentation I could read to understand how to use the pool? Any help appreciated, Thanks Martin
