This issue may occur when connecting using a Private IP.
Cause and Resolution
he Private IP of Cloud Z DB in the AWS environment uses AWS Network Load Balancer (NLB).
The AWS NLB (Network Load Balancer) service performs a connection idle timeout check and closes connections that are not idle.
When using a Private IP:
Since the idle timeout value of AWS NLB is 350 seconds, the application must perform a health check on the connection at intervals shorter than 350 seconds to prevent the connection from becoming idle.
For example, this can be prevented by configuring the idle-timeout
setting in Hikari to a value shorter than 350 seconds.
Additionally, within a K8S Cluster, it is possible to connect using the Cluster IP instead of the Private IP.