title: Timeout waiting for idle object Apache connection Pool
body: <p>I have created a Pool using ConnectionPool like this: </p>
  
  <p>I create some taks to getConection from database and excute them. I only run my application only 3 times, the my application throws Exception.</p>
  
  <pre><code>PoolableObjectFactory mySqlPoolableObjectFactory = new MySqlPoolableObjectFactory(
              host, dbName, user, password);
      Config config = new GenericObjectPool.Config();
      config.maxActive = 10;
      config.testOnBorrow = true;
      config.testWhileIdle = true;
      config.maxIdle = 5;
      config.minIdle = 1;
      config.maxWait = 10000;
      config.timeBetweenEvictionRunsMillis = 10000;
      config.minEvictableIdleTimeMillis = 60000;
  
      GenericObjectPoolFactory genericObjectPoolFactory = new GenericObjectPoolFactory(
              mySqlPoolableObjectFactory, config);
      return genericObjectPoolFactory.createPool();
  
  public Connection getConnectionFromPool() {
  
      Connection conn = null;
  
      try {
  
          conn = (Connection) connPool.borrowObject();
  
      } catch (Exception e) {
  
          e.printStackTrace();
  
      }
  
      return conn;
  }
  </code></pre>
  
  <p>But when I run many thread. It throw Exeption</p>
  
  <pre><code>java.util.NoSuchElementException: Timeout waiting for idle object
      at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1174)
      at vn.vccorp.bigdata.mysql.AdmarketPool.getConnectionFromPool(AdmarketPool.java:76)
  </code></pre>