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 发布时修复它.但即使这样也不确定.
- 发布太少(3 年发布 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 月):
虽然有点跑题:根据我的评估,我决定使用新的 tomcat jdbc-pool - 一年来它在几个生产系统中几乎完美地工作.它的设计非常好,定期更新,可扩展,apache tomcat 团队做了一个 在回答问题/修复问题方面做得很好.
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屋!