This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-16. For the latest, interactive version please visit https://mariadb.com/kb/.

How to set tcpKeepAlive time for each connection.

Hello.

I am creating a client that uses MariaDB Connector / J. This client connects multiple connections. I want to change the time of tcpKeepAlive for each connection. The tcpKeepAlive time is specified in the properties tcp_keepalive_time, tcp_keepalive_interval and tcp_keepalive_probes and cannot be changed when connecting.

Question

1. Is there a way to set different times for each connection using tcpKeepAlive?

2. Is there a method other than tcpKeepAlive to detect disconnection at different times for each connection?

3. If it is difficult to detect disconnection at different times for each connection using the above methods 1 and 2, how should the client connecting to the database detect the disconnection?

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.