简体   繁体   中英

HikariCP connection leak detection in yaml

What is the property name if we need to set leak detection in yaml file? I tried this in yaml and both of these doesn't seem to get picked.

datasource: driver-class-name: com.mysql.cj.jdbc.Driver hikari: maximum-pool-size: 20 leakDetectionThreshold: 60000 # 60 seconds

Do you use spring? See here: https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-sql

Example

 spring:
    datasource:
        url: 'jdbc:mysql://localhost/db?useSSL=false'
        username: root
        password: pass
        driver: com.mysql.jdbc.Driver
        hikari:
            minIdle: 10
            leakDetectionThreshold: 60000 
            maximumPoolSize: 30

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM