What is the best connection pooling library available for Java/JDBC?
I\'m considering the 2 main candidates (free / open-source):
Unfortunately they are all out of date. DBCP has been updated a bit recently, the other two are 2-3 years old, with many outstanding bugs.
For the auto-reconnect issue with DBCP, has any tried using the following 2 configuration parameters?
validationQuery="Some Query"
testOnBorrow=true
I was having trouble with DBCP when the connections times out so I trialled c3p0. I was going to release this to production but then started performance testing. I found that c3p0 performed terribly. I couldn't configure it to perform well at all. I found it twice as slow as DBCP.
I then tried the Tomcat connection pooling.
This was twice as fast as c3p0 and fixed other issues I was having with DBCP. I spent a lot of time investigating and testing the 3 pools. My advice if you are deploying to Tomcat is to use the new Tomcat JDBC pool.
Dbcp is production ready if configured properly.
It is for example used on a commerce Website of 350000 visitors/ day and with pools of 200 connections.
It handles very well timeouts provided you configure it correctly.
Version 2 is on progress and it has a background which makes it reliable since Many Production problems have been tackled.
We use it for our batch server solution and it has been running hundreds of batches That work on millions of lines in database.
Performance tests run by tomcat jdbc pool show it has better performance than cp30.