title: Java Connection Pooling - addObject() query
body: <p>I'm using the apache commons packages to create a connection pool in my java application. The MAXACTIVE value is set to 0 and the MINACTIVE value is set to 1. Using the setMaxWait() method I'm setting the wait time to 30 seconds i.e. once the getConnection() method is called it waits for 30 seconds and if the connection is unavailable it throws an exception (unable to get idle object). </p>
  
  <p>Now inside the catch block I'm calling the method addObject() and getConnection() in succession. I'm able to get a Connection object despite the fact that the MAXACTIVE parameter is set to 0. How is this possible?</p>
  
  <pre><code>try {
      connection = datasource.getConnection();                        
  } catch (Exception e1) {
      try {
          datasource.addObject();
          connection = datasource.getConnection();
      } catch (Exception ignored) {
          /* Ignored */
      }
  }
  </code></pre>
  
  <p>What happens to the pool when the addObject() method is called and how are the various parameters like MAXACTIVE and MINACTIVE affected when a new idle object is created in the pool?</p>