Java - JDBC connection pooling

closed account (3hM2Nwbp)
I've been testing out various libraries for this and I thought that I'd share my experiences. I had stopped testing each library when the first deal-breaker was encountered.

Apache DBCP:
Overhead / Depencencies
The apache pooling library

Documentation - 6 / 10
Usability - 0 / 10

Apache DBCP seems to encounter an internal stack overflow while dealing with a massive load. This (in my mind) means that the library is for the most part unusable until it's resolved. Some areas are documented well, others are not documented at all, or refer the reader to an overly generic catch-all single liner on the top-level. I cannot comment on performance because the library seems to puke with a stack overflow while running the benchmark. I can only assume that it's an internal issue, because the code that I was running was an example on their project page!

C3P0 -
Overhead / Dependencies
No external libraries required

Documentation - 1 / 10
Usability - 8 / 10

The only problem that I had with C3P0 was that I couldn't for the life of me figure out what the code was supposed to do! The documentation is extremely lacking with the main missing information being how to return a connection back to the pool. After digging through the source code to find this information, the connection is returned to the pool when the user "closes" it. I thought that closing a connection, well, actually closes it? Unintuitive, anyone? Shouldn't that have at least a brief mentioning in the documentation? Apparently not...

BoneCP -
Overhead / Dependencies
Google Guava library
SLF4J

Documentation - 10 / 10
Usability - 10 / 10

I'm thoroughly impressed with BoneCP. It may have some steep dependencies, but I was able to set it up completely without even reading the documentation! After initially setting it up, I browsed through the documentation to find the best docs out of any other libraries that I've tried out. BoneCP is also designed with concurrency in mind. By the looks of their benchmark page, it's also one of the best performers.

In conclusion: BoneCP is the winner in my eyes.
Topic archived. No new replies allowed.