善忘技术夹 Logo
善忘技术夹
技术文章 · 1253 阅读

grails dbcp闲置连接超时问题的原因和解决之道

grails dbcp闲置连接超时问题的原因和解决之道

dataSource {
    configClass = GrailsAnnotationConfiguration.class
    pooled = true
    driverClassName = "com.mysql.jdbc.Driver"
    //driverClassName = "com.p6spy.engine.spy.P6SpyDriver" // use this driver to enable p6spy logging
    username = "root"
    password = ""
    dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
    properties {
        minEvictableIdleTimeMillis=1800000
        timeBetweenEvictionRunsMillis=1800000
        numTestsPerEvictionRun=3
        testOnBorrow=true
        testWhileIdle=true
        testOnReturn=true
        validationQuery="SELECT 1"
    }
}

关注「善忘技术夹」全媒体矩阵

扫描上方宣传海报二维码,第一时间获取最新技术文章、开源项目与免安装小程序体验。

善忘技术夹 微信公众号宣传图
微信公众号 (扫码关注)
善忘技术夹 微信小程序宣传图
微信小程序 (扫码即用)