精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2006-08-31
c3p0 官方网站上对:
property name="c3p0.idle_test_period">3600</property> 这个设置的说明,难道输出上面的信息是正确的吗? The most reliable time to test Connections is on check-out. But this is also the most costly choice from a performance perspective. Most applications should work quite reliably using a combination of idleConnectionTestPeriod and testConnectionsOnCheckIn. Both the idle test and the check-in test are performed asynchronously, which leads to better performance, both perceived and actual. Note that for many applications, high performance is more important than the risk of an occasional database exception. In its default configuration, c3p0 does no Connection testing at all. Setting a fairly long idleConnectionTestPeriod, and not testing on checkout and check-in at all is an excellent, high-performance approach. |
|
返回顶楼 | |
发表时间:2006-08-31
我参与开发的实际应用也用C3P0配置就是我上页贴的。
实际应用没有你的问题。 Hiberate3.12+C3P0-0.9.0 所以你看看有没有版本问题或把idle_test_period设成很小测试一下,如500。 good luck! |
|
返回顶楼 | |
发表时间:2006-08-31
谢谢!
在这种情况下,没问题啊 <property name="c3p0.timeout">60</property> <property name="c3p0.idle_test_period">600</property> 或把这个去掉也没问题啊! <property name="c3p0.timeout">60</property> 哎,试的头都大了 |
|
返回顶楼 | |
发表时间:2006-08-31
Hibernate里可以设置的属性不多:
#c3p0-native property name hibernate configuration key #c3p0.acquireIncrement hibernate.c3p0.acquire_increment #c3p0.idleConnectionTestPeriod hibernate.c3p0.idle_test_period #c3p0.initialPoolSize not available -- uses minimum size #c3p0.maxIdleTime hibernate.c3p0.timeout #c3p0.maxPoolSize hibernate.c3p0.max_size #c3p0.maxStatements hibernate.c3p0.max_statements #c3p0.minPoolSize hibernate.c3p0.min_size #c3p0.testConnectionsOnCheckout hibernate.c3p0.validate hibernate 2.x only! 另外的属性你需要配置c3p0.properties 比如: c3p0.acquireRetryDelay=111 c3p0.acquireRetryAttempts=22 c3p0.breakAfterAcquireFailure=true |
|
返回顶楼 | |
发表时间:2006-09-01
谢谢你的回复!
这也许是个好办法,但我用这几个参数就够了,还有就是别人也是配置这几项没有出现这样的问题,我想我的配置或别的地方有什么问题吧,我想在找找原因,也希望各位帮我分析分析啊! 谢谢! |
|
返回顶楼 | |
发表时间:2006-09-02
<property name="c3p0.timeout">60</property>
去掉就可以,明显是连接超时导致的。想想也是60秒就超时,结果可想然知。。。 |
|
返回顶楼 | |
发表时间:2006-09-04
<property name="c3p0.timeout">60</property>
去掉就可以,明显是连接超时导致的。想想也是60秒就超时,结果可想然知。。。 如果去掉此属性,莫认为“0”吧,那不就没有“连接的过期时间”了啊, 还有这句话什么意思:”想想也是60秒就超时,结果可想然“ |
|
返回顶楼 | |
发表时间:2006-09-04
也就是说超时操作,导致了你的问题。
|
|
返回顶楼 | |
发表时间:2006-09-05
为什么我设那么短还超时啊?
|
|
返回顶楼 | |
发表时间:2006-09-08
谁遇到过啊?我上网查很多人都遇到过,可是都不知道怎么解决啊?
我的日志里时常输出那些死锁的信息啊,而且程序运行正常,为什么啊? |
|
返回顶楼 | |