postgresql 连接超时:Could not open JDBC Connection for transaction; nested exception is java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 10000ms.
出现这个问题后,会一直连接不上数据库,重启jar包之后就没事了,之前修改了一下数据源相关的连接数配置,pgsql的最大连接配置设置成了100,没有什么效果。
数据源配置:
hikari:
auto-commit: false
connection-timeout: 10000
idle-timeout: 25000
login-timeout: 5
max-lifetime: 30000
read-only: false
validation-timeout: 3000
maximum-pool-size: 100
minimum-idle: 30
data-source-properties:
cachePrepStmts: true
prepStmtCacheSize: 250
prepStmtCacheSqlLimit: 2048
useServerPrepStmts: true
useLocalSessionState: true
rewriteBatchedStatements: true
cacheResultSetMetadata: true
cacheServerConfiguration: true
elideSetAutoCommits: true
maintainTimeStats: false
这个项目每隔20s会执行两三个定时任务,我怀疑是不是定时任务产生的这个问题。