Possibly consider using a shorter maxLifetime value.解决方法

编程知识 更新时间:2023-04-05 19:46:06

【现象】

2022-08-24 14:54:49.130  WARN 174160 --- [nio-8082-exec-3] com.zaxxer.hikari.pool.PoolBase          : HikariPool-1 - Failed to validate connection com.mysql.cj.jdbc.ConnectionImpl@7df9ca28 (No operations allowed after connection closed.). Possibly consider using a shorter maxLifetime value.

2022-08-24 14:54:54.146  WARN 174160 --- [nio-8082-exec-3] com.zaxxer.hikari.pool.PoolBase          : HikariPool-1 - Failed to validate connection com.mysql.cj.jdbc.ConnectionImpl@7150aa4 (No operations allowed after connection closed.). Possibly consider using a shorter maxLifetime value.

2022-08-24 14:54:54.154  WARN 174160 --- [nio-8082-exec-2] com.zaxxer.hikari.pool.PoolBase          : HikariPool-1 - Failed to validate connection com.mysql.cj.jdbc.ConnectionImpl@16c7f560 (No operations allowed after connection closed.). Possibly consider using a shorter maxLifetime value.

【解决方法】

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/user?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
    username: root
    password: root

修改为:

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/user?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
    username: root
    password: root
    hikari:
      connection-timeout: 10000
      validation-timeout: 3000
      idle-timeout: 60000
      login-timeout: 5
      max-lifetime: 60000
      maximum-pool-size: 10
      minimum-idle: 5
      read-only: false

更多推荐

Possibly consider using a shorter maxLifetime value.解决方法

本文发布于:2023-04-05 19:46:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/6f1a48f15a7323a2619f404c93750403.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:解决方法   Possibly   shorter   maxLifetime

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 47287文章数
  • 14阅读数
  • 0评论数