From 313de95e6f5f98dee996c0dc45f978160db2412f Mon Sep 17 00:00:00 2001 From: tamassoltesz Date: Tue, 29 Apr 2025 14:25:27 +0200 Subject: [PATCH] fix: add tcpKeepAlive to connectionPool config --- CHANGELOG.md | 4 ++++ build.gradle | 2 +- .../io/supertokens/storage/postgresql/ConnectionPool.java | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a28f568e..f74186dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [8.1.3] + +- Adds tcpKeepAlive to the connection pool config + ## [8.1.2] - Adds user_id index to the user roles table diff --git a/build.gradle b/build.gradle index a46c3418..4dd77cc3 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java-library' } -version = "8.1.2" +version = "8.1.3" repositories { mavenCentral() diff --git a/src/main/java/io/supertokens/storage/postgresql/ConnectionPool.java b/src/main/java/io/supertokens/storage/postgresql/ConnectionPool.java index 70af1f53..8ebb7af3 100644 --- a/src/main/java/io/supertokens/storage/postgresql/ConnectionPool.java +++ b/src/main/java/io/supertokens/storage/postgresql/ConnectionPool.java @@ -91,6 +91,7 @@ private synchronized void initialiseHikariDataSource() throws SQLException, Stor config.addDataSourceProperty("cachePrepStmts", "true"); config.addDataSourceProperty("prepStmtCacheSize", "250"); config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); + config.addDataSourceProperty("tcpKeepAlive", "true"); // TODO: set maxLifetimeValue to lesser than 10 mins so that the following error doesnt happen: // io.supertokens.storage.postgresql.HikariLoggingAppender.doAppend(HikariLoggingAppender.java:117) | // SuperTokens