[DruidAbstractDataSource] maxIdle is deprecated

来源:互联网 发布:吉利知豆电动汽车官网 编辑:程序博客网 时间:2024/04/30 10:45

问题:我项目用的是com.alibaba.druid.pool.DruidDataSource这个数据源,项目启动的时候报这种问题:maxIdle is deprecated,maxIdle属性被忽略(过时的)

环境:数据源jar用的是druid0.2.9 

分析问题:

打开源代码看到:标记这个方法已经过时了。


替代方案:

the maxIdle property for Druid compatible with DBCP, maxIdle is a confusing concept. the connection pool should only maxPoolSize and minPoolSize,druid retain only maxActive and minIdle, respectively the equivalent maxPoolSize and minPoolSize.
说明maxIdle已经被替代了,用maxActive和minIdle来表示数据库连接池的maxPoolSize和minPoolSize.

参考文档:https://github.com/alibaba/druid/wiki/FAQ

https://github.com/alibaba


0 0
原创粉丝点击