开发者

dbcp having problems returning connections when database is unavailable

开发者 https://www.devze.com 2022-12-22 20:59 出处:网络
I found the following link by erickson dated jan 29, 2009: Is DBCP (Apache Commons Database Connection Pooling) still relevant?

I found the following link by erickson dated jan 29, 2009:

Is DBCP (Apache Commons Database Connection Pooling) still relevant?

"DBCP has serious flaws. I don't think it's appropriate for a production application, especially when so many drivers support pooling in their DataSource natively.

The straw that broke the camel's back, in my case, was when I found that the entire pool was locked the whole time a new connection attempt is made to the database. So, if something happens to your database that results in slow connections or timeouts, other threads are blocked when they try to return a connection to the pool—even though they are done using a database."

I was wondering if much had changed or improved with dbcp since this post. I am seeing this EXACT problem in my production system.

Does anyone have any alternatives to dbcp? I use it in a database connection framework...basically, I inherited a framework where the engineers thought it would be fun to rewrite hibernate. don't ask...it's a long and sordid tale. Anyway, I'm having these problems returning connectio开发者_StackOverflow社区ns to the pool when the database is slow/down. Any ideas, suggestions, alternatives?


Try BoneCP: http://jolbox.com

For your case, it has release helper threads that will take care of releasing a connection slowly or whatever.

0

精彩评论

暂无评论...
验证码 换一张
取 消