File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,7 +114,16 @@ class BaseConnection()
114114
115115 * connected()
116116 - Implement this method to get the status of the connection. It should
117- return True for connected, otherwise False
117+ return True for connected, otherwise False. This is a local check
118+ only (e.g. inspecting driver-level state) and may not detect
119+ server-side disconnects. Use connection_ping() when a network-level
120+ check is required.
121+
122+ * connection_ping()
123+ - Implement this method to verify the connection is alive by sending a
124+ lightweight query (e.g. SELECT 1) to the server. Returns True if the
125+ server responds, False otherwise. Unlike connected(), this detects
126+ stale or half-open TCP connections that were silently dropped.
118127
119128 * reset()
120129 - Implement this method to reconnect the database server (if possible)
You can’t perform that action at this time.
0 commit comments