We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
在Druid-1.0.27之前的版本,DruidDataSource建议使用TestWhileIdle来保证连接的有效性,但仍有很多场景需要对连接进行保活处理。在1.0.28版本之后,新加入keepAlive配置,缺省关闭。使用keepAlive功能,建议使用最新版本,比如1.1.21或者更高版本
-Ddruid.keepAlive=true
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"> <property name="keepAlive" value="true" /> </bean>
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"> <property name="connectionProperties" value="keepAlive=true" /> </bean>