JiveJdon Community Forums
在线278人   首页   主题表   培训咨询   标签   精华   查搜   注册    登陆 RSS
首页 » 论坛 » J2EE/JavaEE/JEE/EJB/JSF等技术讨论
???en_US.forumThreadPrev.name??? 上一主题
  Go back to the topic 返回本主题   Go back to the topic listing返回主题列表
???en_US.forumThreadNext.name??? 下一主题
Go 总共有 2 回复 / 1
 发表新帖子   回复该主题贴
AdonChen

悄悄话
发表文章: 7
注册时间: 2007年06月25日 15:45
关于hibernate使用c3p0连接池的问题. 2007年07月08日 11:11 到本帖网址 加入本帖到收藏夹 发送到手机 回复该主题
标签列表
曾经一个已经投入运行的项目,是用Struts+hibernate组件,后来再把工程打开来运行时,配置不变的情况下,却提示:
10:40:11,046 INFO C3P0Registry:77 - Initializing c3p0-0.9.0 [built 11-July-2005 00:43:29 -0400; debug? true; trace: 10]
10:40:11,562 INFO PoolBackedDataSource:257 - Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@1606bf5 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@196c0a0 [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 196c0a0, idleConnectionTestPeriod -> 100, initialPoolSize -> 10, maxIdleTime -> 100, maxPoolSize -> 100, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@29d838 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 29d838, jdbcUrl -> jdbc:microsoft:sqlserver://localhost:1433, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> 1606bf5, numHelperThreads -> 3 ]
10:41:14,093 WARN BasicResourcePool:1222 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@f8db08 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30).
10:41:14,515 WARN Configurator:126 - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: file:/D:/Tomcat/work/Catalina/localhost/KBPM/loader/ehcache-failsafe.xml
10:41:15,281 WARN BasicResourcePool:1222 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4dd413 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30).
10:42:29,546 WARN BasicResourcePool:1222 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@19d56e9 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30).
10:42:29,546 ERROR JDBCExceptionReporter:72 - Connections could not be acquired from the underlying database!
10:42:29,578 ERROR BaseHibernateDAO:204 - 查询数据库失败
10:42:29,578 INFO ConfigConstants:40 - 调用getProperty
10:42:29,578 WARN RequestProcessor:516 - Unhandled Exception thrown: class java.lang.NullPointerException
----------------------------------------------------
hibernate的配置文件关于c3p0的代码片段如下:
<!-- configuration pool via c3p0-->
<property name="c3p0.acquire_increment">30</property>
<property name="c3p0.idle_test_period">100</property> <!-- seconds -->
<property name="c3p0.max_size">100</property>
<property name="c3p0.max_statements">0</property>
<property name="c3p0.min_size">10</property>
<property name="c3p0.timeout">100</property> <!-- seconds -->
<!-- DEPRECATED very expensive property name="c3p0.validate>-->
其中c3p0.acquire_increment曾设成1,10,100,31如今是设成30,但都是一样的效果,请熟悉的人指点一下原因.
banq

悄悄话
发表文章: 9528
注册时间: 2002年08月03日 17:08
回复:关于hibernate使用c3p0连接池的问题. 2007年07月16日 13:47 到本帖网址 加入本帖到收藏夹 发送到手机 回复该主题
虽然不能帮你,但罗嗦几句。完全没有必要使用C3p0之类专门的连接池,直接使用服务器的连接池就可以,真正性能提升设计在于自己的应用程序。我个人认为更换连接池的代价还不如升级个新CPU或内存。
wlmouse

悄悄话
发表文章: 117
注册时间: 2006年11月09日 15:58
re:关于hibernate使用c3p0连接池的问题. 2007年07月17日 10:54 到本帖网址 加入本帖到收藏夹 发送到手机 回复该主题
很明显,链接数据库错误。不是链接数量的问题而是根本就没有连接到数据库。请检查链接的URl参数、用户名密码和数据库驱动是否正常。可以先去掉连接池试一下。
这个主题有 2 回复 / 1Go
???en_US.forumThreadPrev.name??? 上一主题
  Go back to the topic 返回本主题   Go back to the topic listing返回主题列表    返回页首返回页首
???en_US.forumThreadNext.name??? 下一主题
热点TAG: AOP cache 缓存 DDD EJB 集群 设计模式 Hibernate IOC JiveJdon OO RBAC Seam Spring Struts
正在读取,请等待...
google yahoo 新浪ViVi 365Key网摘 天极网摘 CSDN网摘 添加到百度搜藏 POCO网摘 博采网摘
查询本论坛内 回复超过的热门帖子
     回复该主题贴
标题
 
粗体 斜体 下划线 插入图片 插入代码 插入url链接 插入附件
内容
  每2分种自动备份发贴内容Ctrl-V粘贴取出,提问题前先查询标签列表

RSS 手机阅读 add to google add to yahoo
解惑之道在J道 ,打造中国最具影响力的的企业软件社区
OpenSource JIVEJDON v3.0 Powered by JdonFramework Code © 2002-08 jdon.com

anti spam