J
Jose_Manuel_Jurado
Using a network trace, I observed that once the connections are established and to keep them active, the operating system sends a TCP Keep-Alive, which indicates how often it checks that the connection remains active in the HikariCP connection pool.
In this situation, my first idea for idle connection in the HikariCP pool was to configure KeepAliveTime parameter. HikariCP will send a lightweight query (such as SELECT 1) to idle connections that have been inactive for longer than this parameter value. This keeps the connection alive, avoiding unexpected disconnections by external systems.
We could see the results in the following network trace and SQL Profiler.
Network setups, such as those involving firewalls, have policies that close idle connections after a certain period. If a connection is closed in this way and keepalivetime is not set, HikariCP will only detect the closure when the connection is requested from the pool.
Enjoy!
Continue reading...
In this situation, my first idea for idle connection in the HikariCP pool was to configure KeepAliveTime parameter. HikariCP will send a lightweight query (such as SELECT 1) to idle connections that have been inactive for longer than this parameter value. This keeps the connection alive, avoiding unexpected disconnections by external systems.
We could see the results in the following network trace and SQL Profiler.
Network setups, such as those involving firewalls, have policies that close idle connections after a certain period. If a connection is closed in this way and keepalivetime is not set, HikariCP will only detect the closure when the connection is requested from the pool.
Enjoy!
Continue reading...