1

I'm facing the following problem in my application that after a while running it starts to show the following warn.

HikariPool-1 - Failed to validate connection ConnectionID:19 ClientConnectionId: cea9b6e9-baac-495d-8f9b-08723893b6d9 (The connection is closed.). Possibly consider using a shorter maxLifetime value.

I already set the maxLifetime property to 600000 in my application.yml but the problem still persists.

Do I have other Hikari settings to configure?

I'm using spring boot 2.5.12 and data base Sql Server 2017

application.yml

spring:
  main:
    allow-circular-references: true
  datasource:
    hikari:
      maxLifetime: 600000
    url: jdbc-url
    username: userName
    password: passwaord
    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
  jpa:
    open-in-view: false
    properties:
      hibernate:
        dialect: org.hibernate.dialect.SQLServer2012Dialect
        proc:
          param_null_passing: true
    show-sql: false
  data:
    web:
      pageable:
        default-page-size: 20
Ger
  • 583
  • 2
  • 13
  • 35
  • Just a quick tip, try logging or debugging the Hikari configuration classes to make sure the configuration is getting set. I have seen cases where the configs weren't being set as I expected. – Copy and Paste Aug 17 '22 at 17:54
  • Try to also have a look on similar questions : https://stackoverflow.com/questions/60310858/possibly-consider-using-a-shorter-maxlifetime-value-hikari-connection-pool-spr https://stackoverflow.com/questions/46830159/hikari-failed-to-validate-connection-because-connection-is-closed https://stackoverflow.com/questions/60301008/failed-to-validate-connection-this-connection-has-been-closed-possibly-consi Maybe you find some useful infromation – cUser Nov 22 '22 at 13:33

0 Answers0