title: java ldap connection pool timeout property not working as expected
body: <p>In java LDAP connection pooling, I have noticed that the pool timeout setting property is not working properly. Given below are the ldap connection pooling logs while testing my application.</p>
  
  <p>Following are the values for initSize &amp; pool timeout properties
  <strong>com.sun.jndi.ldap.connect.pool.initsize = 10</strong></p>
  
  <p><strong>com.sun.jndi.ldap.connect.pool.timeout = 300000</strong></p>
  
  <p>==================== LDAP LOGS ======================</p>
  
  <p>21:38:48,480  Create com.sun.jndi.ldap.LdapClient@e2d0ca3</p>
  
  <p>21:38:48,480  Create com.sun.jndi.ldap.LdapClient@4f652edf</p>
  
  <p>21:38:48,495  Create com.sun.jndi.ldap.LdapClient@53bb2d84</p>
  
  <p>21:38:48,558  Create com.sun.jndi.ldap.LdapClient@45766ee8</p>
  
  <p>21:38:48,558  Create com.sun.jndi.ldap.LdapClient@703c62f5</p>
  
  <p>21:38:48,573  Create com.sun.jndi.ldap.LdapClient@279dd5ca</p>
  
  <p>21:38:48,589  Create com.sun.jndi.ldap.LdapClient@51c329b8</p>
  
  <p>21:38:48,605  Create com.sun.jndi.ldap.LdapClient@7ec5afb0</p>
  
  <p>21:38:48,605  Create com.sun.jndi.ldap.LdapClient@3e3659c6</p>
  
  <p>21:38:48,620  Create com.sun.jndi.ldap.LdapClient@5bef29e1</p>
  
  <p><strong>21:38:48,620  Create and use com.sun.jndi.ldap.LdapClient@332bf735</strong></p>
  
  <p><strong>21:38:50,102  Release com.sun.jndi.ldap.LdapClient@332bf735</strong></p>
  
  <p>21:41:05,661  Expired com.sun.jndi.ldap.LdapClient@e2d0ca3 expired</p>
  
  <p>21:41:05,661  Expired com.sun.jndi.ldap.LdapClient@4f652edf expired</p>
  
  <p>21:41:05,661  Expired com.sun.jndi.ldap.LdapClient@53bb2d84 expired</p>
  
  <p>21:41:05,661  Expired com.sun.jndi.ldap.LdapClient@45766ee8 expired</p>
  
  <p>21:41:05,662  Expired com.sun.jndi.ldap.LdapClient@703c62f5 expired</p>
  
  <p>21:41:05,693  Expired com.sun.jndi.ldap.LdapClient@279dd5ca expired</p>
  
  <p>21:41:05,693  Expired com.sun.jndi.ldap.LdapClient@51c329b8 expired</p>
  
  <p>21:41:05,693  Expired com.sun.jndi.ldap.LdapClient@7ec5afb0 expired</p>
  
  <p>21:41:05,693  Expired com.sun.jndi.ldap.LdapClient@3e3659c6 expired</p>
  
  <p>21:41:05,709  Expired com.sun.jndi.ldap.LdapClient@5bef29e1 expired</p>
  
  <h2><strong>21:46:05,724  Expired com.sun.jndi.ldap.LdapClient@332bf735 expired</strong></h2>
  
  <p>When the application requested for a first LDAP connection, 10 new connections are created (as init size is set to 10) along with the requested connection. After the used connection is released back to pool, it is not expired after 5 mins and same is the case with other 10 connections. I am not sure why the ldap pool timeout property is not working properly as I am getting different behaviors (some times connections getting expired in 1 min) while testing the same scenario different times. Has any one has experienced the same kind of behavior and any resolution for this?</p>