Keeping Connections Alive
Databases can be set up to end sessions that have been idle for some time, and networks often close idle TCP/IP connections. With Connection Keep-Alive, DbVisualizer checks idle connections at regular intervals, so that they stay open.
To turn on keep-alive for a connection:
- Open the Object View tab for the connection, and select its Properties tab.
- Select the Physical Connection category.
- Select Connection Keep-Alive. It is off by default.
- Optionally, change Connection Idle Time: how many seconds a connection is idle before it is checked. The default is 120.
- Click Apply.
To check the connection, DbVisualizer runs the SQL in Validation and Keep-Alive SQL, such as SELECT 1. If the field is empty, DbVisualizer asks the database driver whether the connection is still valid instead. After three failed checks in a row, DbVisualizer stops checking.
To turn on keep-alive for all connections of a database type, set the same options in Tools → Tool Properties, in the Database tab.
Keep-Alive doesn't help when a connection is closed for other reasons, such as a database restart. Connections that are busy, for example running a long query, are not checked, so a network time-out can still happen. In that case, the network must be set up to allow long-running statements.