AbandonedObjectPool 的相關屬性
来源:互联网 发布:美洲文明落后知乎 编辑:程序博客网 时间:2024/06/12 18:25
AbandonedObjectPool is used什么情况?
AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@7c12a1)LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 300
将dataSource的配置 removeAbandoned = true去掉即可。
详解:
引用
在配置时,主要难以理解的主要有:removeAbandoned 、logAbandoned、removeAbandonedTimeout、maxWait这四个参数,设置了rmoveAbandoned=true 那么在getNumActive()快要到getMaxActive()的时候,系统会进行无效的Connection的回收,回收的 Connection为removeAbandonedTimeout(默认300秒)中设置的秒数后没有使用的Connection,激活回收机制好像是getNumActive()=getMaxActive()-2。 有点忘了。
logAbandoned=true的话,将会在回收事件后,在log中打印出回收Connection的错误信息,包括在哪个地方用了Connection却忘记关闭了,在调试的时候很有用。
在这里私人建议maxWait的时间不要设得太长,maxWait如果设置太长那么客户端会等待很久才激发回收事件。
以下是我的配置的properties文件:
#连接设置
jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
jdbc.url=jdbc:oracle:thin:@127.0.0.1:1521:DBSERVER
jdbc.username=user
jdbc.password=pass
#<!-- 初始化连接 -->
dataSource.initialSize=10
#<!-- 最大空闲连接 -->
dataSource.maxIdle=20
#<!-- 最小空闲连接 -->
dataSource.minIdle=5
#最大连接数量
dataSource.maxActive=50
#是否在自动回收超时连接的时候打印连接的超时错误
dataSource.logAbandoned=true
#是否自动回收超时连接
dataSource.removeAbandoned=true
#超时时间(以秒数为单位)
dataSource.removeAbandonedTimeout=180
#<!-- 超时等待时间以毫秒为单位 6000毫秒/1000等于60秒 -->
dataSource.maxWait=1000
logAbandoned=true的话,将会在回收事件后,在log中打印出回收Connection的错误信息,包括在哪个地方用了Connection却忘记关闭了,在调试的时候很有用。
在这里私人建议maxWait的时间不要设得太长,maxWait如果设置太长那么客户端会等待很久才激发回收事件。
以下是我的配置的properties文件:
#连接设置
jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
jdbc.url=jdbc:oracle:thin:@127.0.0.1:1521:DBSERVER
jdbc.username=user
jdbc.password=pass
#<!-- 初始化连接 -->
dataSource.initialSize=10
#<!-- 最大空闲连接 -->
dataSource.maxIdle=20
#<!-- 最小空闲连接 -->
dataSource.minIdle=5
#最大连接数量
dataSource.maxActive=50
#是否在自动回收超时连接的时候打印连接的超时错误
dataSource.logAbandoned=true
#是否自动回收超时连接
dataSource.removeAbandoned=true
#超时时间(以秒数为单位)
dataSource.removeAbandonedTimeout=180
#<!-- 超时等待时间以毫秒为单位 6000毫秒/1000等于60秒 -->
dataSource.maxWait=1000
轉載至:http://blog.csdn.net/demon_chin/article/details/7998610
- AbandonedObjectPool 的相關屬性
- 数据库连接池DBCP框架的研究以及源代码分析三:打开AbandonedObjectPool连接池
- AbandonedObjectPool is used什么情况?
- AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@37773777) LogAbandoned: t
- AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@37773777) LogAbandoned: t
- JAVA中报错AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@f70ee1)
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- mCAS之VIP
- 一个CAsyncSocket例子
- ubuntu 常见错误--Could not get lock /var/lib/dpkg/lock
- Devexpress XtraReport 设置页面大小单位
- PHP 知识汇总
- AbandonedObjectPool 的相關屬性
- 计算机网络
- S5PV310 Android 电容屏驱动调试
- web服务器iptables策略
- 《Effective C++》简明笔记-中
- yahoo前端优化34条规则——Server篇
- ubuntu的dos2unix
- c++ class does not name a type
- Perl useage