title: DB Connection Starvation
body: <p>I am using Spring 2.5; a SimpleJdbcTemplate using apache-commons-dbcp connection pooling. There is also a thread pool which spawns a thread when a query is run (several queries are performed and their results processed once all are complete, so the threads are spawned to run queries in parallel).</p>
  
  <p>Eventually, all the threads are waiting on getConnection() in a TIMED_WAIT. No thread seems to get a Connection. I check the DB and the connections are all idle.</p>
  
  <p>What is causing this? I have 10 connections as the max Pool size and 50-100 threads. How should I be configuring this? The DBA says that should be enough connections (and I agree since they are all idle).</p>
  
  <p>The same thing happens with BoneCP as the datasource for the SimpleJdbcTemplate as well.</p>