1. 问题背景

数据批量入库时,报错:HikariPool-1 - Connection is not available, request timed out after 30040ms.

2. 问题处理

yml配置文件中加入hikari配置:

  datasource:
    driver-class-name: org.postgresql.Driver
    url: jdbc:postgresql://ip:port/dbName
    username: aaa
    password: bbb
    hikari:
      connection-timeout: 60000
      maximum-pool-size: 500
      max-lifetime: 180000
      minimum-idle: 20
      validation-timeout: 3000
      idle-timeout: 30000

更多推荐

Pg报错: HikariPool-1 - Connection is not available, request timed out after 30040m