Menu

FastestConnectServerSet: initialConnections = 1, maxConnections=2 and using JVM to reclaim pool leaves many connections active

2019-02-01
2019-02-01
  • Surendar Chandra

    I use the FastestConnectServerSet. Periodically I create a new connection pool and let the old one be garbage collected by JVM. Should I explicitly close() the unused connection pools? Thanks

     
  • Neil Wilson

    Neil Wilson - 2019-02-01

    In general, it’s a good practice to always explicitly close connections and connection pools whenever you no longer need them. The LDAPConnection and LDAPConnectionPool classes do have finalize methods that call the close method, but the JVM doesn’t make any guarantees about when (or even if) the finalize method will be run, so it’s better to close them explicitly so that you know you don’t have stray connections lying around consuming file descriptors on both the client and the server.

     
  • Surendar Chandra

    Thanks

     

Log in to post a comment.