项目启动不报错,如果静默15分钟没有数据库操作就报上述错误WARN 不影响程序运行
Failed to validate connection com.mysql.cj.jdbc.ConnectionImpl@16244d67 (No operations allowed after connection closed.). Possibly consider using a shorter maxLifetime value.
发现SpringBoot2开始配置文件有所变化
spring:
#数据库
datasource:
url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
password: root
username: root
driver-class-name: com.mysql.cj.jdbc.Driver
hikari:
max-lifetime: 30000 # 不能小于30秒,否则默认回到1800秒
- ConnectionImpl SpringBoot2 SpringBoot connection validateconnectionimpl springboot2 springboot connection springboot2 implemented connection endpoint validate springboot2 springboot springboot2 springboot swagger3 swagger springboot2 springboot mybatis springboot2 springboot lettuce redis springboot2 springboot spring3 spring springboot2 springboot后台 管理系统 springboot2 springcache springboot