Oracle通用连接池(UCP)有多好 [英] How good is Oracle Universal Connection Pool (UCP)
问题描述
有人在实际生产负载下使用Oracle UCP有经验吗? 它能否很好地处理数据库重新连接? 有多线程问题吗? 有没有人将它与C3P0或Apache DBCP进行比较?
Does anybody have experience with using Oracle UCP under real production load? Does it handle database reconnects well? Are there any multi-threading issues? Has anybody compared it with C3P0 or Apache DBCP?
推荐答案
我评估了UCP 11.2.0.1 ,以替代我们的旧版连接池,我不推荐 :
I evaluated UCP 11.2.0.1 as a replacement for our legacy connection pool and I cannot recommend it:
- 它不完全支持jdk 6 /ojdbc6.jar.例如,使用语句缓存和jmx-support不适用于Java 6并引发异常.
- 无内部语句缓存-它依赖于jdbc驱动程序的语句缓存(
setPoolable()
) - 我将这两个问题都提交给了oracle,他们确认了这一问题,并可能会在oracle 12.0发布时修复它.但这还不能肯定.
- 发行版太少(三年内发行2个),社区支持也太少.
- 非开源
- 很难扩展..只有很少的回调具有令人讨厌的界面设计.
示例:您想在连接超过其TTL时收到通知吗?准备包装器数据源和内部/专有UCP API的大量使用.官方文档(最新更新:2008年)仍然保持沉默. - 胖设计(将近0.5 MB的jar)-许多具有相似名称/功能的类(例如,有一个
PoolDataSource
和ConnectionPool
-两者都是相关的,但调用方式有所不同并提供功能略有不同.)
仅 - java.util.logging
- it does not fully support jdk 6 / ojdbc6.jar. For example the use of statement caching and jmx-support does not work with java 6 and throws exceptions.
- no internal statement cache - it relies on the jdbc driver's statement cache (
setPoolable()
) - I submitted both issues to oracle, they confirmed it and will probably fix it when oracle 12.0 will be released. But even that's not for sure.
- Too few releases (2 releases in 3 years), too less community support.
- Not Open-Source
- Hardly extensible. Only a few callbacks with an horrible interface design.
Example: You want to be notified when a Connection exceeds its TTL? Prepare for a wrapper DataSource and a mass usage of internal/proprietary UCP APIs. The official documentation (last update: 2008) remains silent how to achive this. - Fat design (almost a 0,5 MB jar) - many classes with similar names/function (e.g. there's a
PoolDataSource
and aConnectionPool
- both are related but invoked differently and provide slightly different functionality.) - java.util.logging only
更新1(2014年4月):
尽管有点偏离主题:经过评估,我决定使用新的在回答问题/解决问题方面做得很好.
UPDATE 1 (April 2014):
Although slightly off-topic: As a result of my evaluation I decided to go with the new tomcat jdbc-pool - and it is working almost perfectly since a year in several production systems. It's very well designed, updated regularly, extensible and the apache tomcat team does a good job in responding to questions/fixing issues.
更新2(2016年7月):
现在,我可以强烈推荐 HikariCP ,我目前比所有其他连接池都更喜欢它.
它的架构,对正确性和性能的关注真是太神奇了.
UPDATE 2 (July 2016):
I can now highly recommend HikariCP which I'm currently favoring over all other connection pools.
Its architecture, focus on correctness and performance is just amazing.
这篇关于Oracle通用连接池(UCP)有多好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!