Attribute

KeepConnectionActive (KCA)

Purpose

Specifies whether the driver periodically sends lightweight SQL operations to the database after a connection has been idle for the time specified by the Socket Idle Time (SocketIdleTimeCheckInterval) option. The SQL operation resets the Azure SQL Gateway or database idle timeout timer to keep the connection open.

Valid Values

0 | 1

Behavior

If set to 0 (Disabled), the driver does not send lightweight SQL operations the database to keep the connection open. Once a connection is idle for the duration specified by the Azure SQL Gateway or database, the connection times out.

If set to 1 (Enabled), the driver periodically sends lightweight SQL operations to the database to keep the connection active. Once a connection is idle for the duration specified by the Socket Idle Time option, the driver executes a lightweight query (Select 0) to the database to prevent the connection from timing out.

Default

0 (Disabled)

Notes

  • This option differs from TCP Keep Alive (KeepAlive) in that it maintains the connection to the database or Azure SQL Gateway, while TCP Keep Alive maintains only the TCP socket. If you have a database or gateway timeout, you will need to enable this functionality to prevent your connection from terminating during idle periods.

GUI Tab

Advanced tab

See Also