title: mybatis POOLED datasource
body: <p>I'm using myBatis <a href="https://github.com/mybatis/mybatis-3/blob/master/src/main/java/org/apache/ibatis/datasource/pooled/PooledDataSource.java" rel="nofollow">POOLED datasource</a>  . Below are the connection pool configuration -  </p>
  
  <pre><code>poolMaximumIdleConnections: 5
  poolMaximumActiveConnections: 20
  </code></pre>
  
  <p>I hit the service with <code>102, 742 request (160 TPS)</code> and got the below metrics by enabling mybatis log-</p>
  
  <pre><code>No of Request: 102,742
  
  No of Created connection: 8,841
  No of Checked out connection: 93,901
  
  No of Returned connection: 93,911
  No of Closed connection: 8,831
  
  No of Claimed overdue connection: 0
  No of bad connection: 0
  </code></pre>
  
  <ol>
  <li>Why 8,841 connection got created if pool size is 20. Shouldn't it create only 20 connection and reuse from the pool ?</li>
  <li>There're 8,841 connection which got created but only 8,831 got closed. Does this mean 10 connection were still open out there - connection leak ? </li>
  </ol>