java Tomcat JDBC 连接池 VS c3p0 连接池

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4774100/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 07:57:32  来源:igfitidea点击:

Tomcat JDBC connection pool VS c3p0 Connection pool

javatomcatconnectionconnection-poolingc3p0

提问by YaOg

I recently came across this connection pool implementation.

我最近遇到了这个连接池实现。

http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html

http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html

I find it quite interesting.

我觉得很有趣。

Did anyone try this out? I think it looks great except the fact that it does not support automatic retry and statement cache like c3p0.

有没有人试过这个?我认为它看起来很棒,除了它不支持像 c3p0 这样的自动重试和语句缓存。

Does anyone one know how it compares to c3p0?

有谁知道它与c3p0相比如何?

Till now I used c3p0 but I find it's connection handling in a multi-thread environment problematic. It opens way too much connections compared to number of application threads.

直到现在我使用 c3p0 但我发现它在多线程环境中的连接处理有问题。与应用程序线程的数量相比,它打开了太多的连接。

Thanks.

谢谢。

回答by BalusC

I've used it in one of my projects and it works great.

我在我的一个项目中使用过它,效果很好。

I can think of only one online article which compares Tomcat pool to C3P0: tomcatexpert.com. The C3P0 benches are however pretty off, their excuse was that they couldn't configure it to its max on Tomcat.

我只能想到一篇将 Tomcat 池与 C3P0 进行比较的在线文章:tomcatexpert.com。然而,C3P0 工作台相当糟糕,他们的借口是他们无法在 Tomcat 上将其配置为最大。

I'd say, for the most reliable data, just give it a try and bench yourself. I did and it satisfied me.

我想说,要获得最可靠的数据,请自己尝试一下。我做到了,它让我很满意。

See also:

也可以看看: