Today we've done a stress test on our application and observed some new behavior - many of the functions that we're delegating to Quartz Scheduler (each with its own Thread) started to take quite a while to complete, and queued up.

Did a Thread Dump, revealing many of these Threads to be in BLOCKED state, referencing a WeakHashMap while either attempting to register or unregister a connection from the pool.

There seems to be couple of possibilities1) Long running genuine SQL's2) Untuned SQL's which are taking longer time to get execute thus making the connection unavailable to pool for longer time .For the "long running SQL's " you would have to configure the pool with larger number of connections and for the latter case you got to optimize the application code (fine tune SQL's) .