我找到了埃里克森于 2009 年 1 月 29 日发布的以下链接:
DBCP(Apache Commons 数据库连接池)仍然相关吗?
“DBCP 有严重的缺陷,它不适合生产应用程序,尤其是当如此多的驱动程序本身支持数据源中的池化时
。就我而言,压垮骆驼的最后一根稻草是当我发现在对数据库进行新连接尝试的整个过程中整个池都被锁定,因此,如果您的数据库发生了导致连接缓慢或超时的情况,其他线程在尝试将连接返回到池时会被阻塞 - 即使它们是使用数据库完成的。”
我想知道自这篇文章以来 dbcp 是否发生了很大的变化或改进。我在我的生产系统中看到了这个确切的问题。
有人有 dbcp 的替代品吗?我在数据库连接框架中使用它......基本上,我继承了一个框架,工程师认为重写 hibernate 会很有趣。别问……这是一个漫长而肮脏的故事。无论如何,当数据库缓慢/缓慢时,我在将连接返回到池时遇到这些问题。有什么想法、建议、替代方案吗?
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 connections to the pool when the database is slow/down. Any ideas, suggestions, alternatives?
发布评论
评论(1)
尝试 BoneCP: http://jolbox.com
对于您的情况,它具有发布帮助线程,该线程将负责发布连接缓慢或其他什么。
Try BoneCP: http://jolbox.com
For your case, it has release helper threads that will take care of releasing a connection slowly or whatever.