You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 26, 2026. It is now read-only.
The isValid method in a JDBC connection is used by connection pools to determine whether a connection is safe to hand out to an application. Executing a query each time for this is not very efficient for Cloud Spanner, as the Cloud Spanner JDBC connection is just a wrapper around the client library, and does not implement a physical connection with Cloud Spanner. This means that loss of network connectivity is 'all-or-nothing'; if the network connection to Cloud Spanner has been lost, then it will apply to all JDBC connections, and not only a specific one. There is therefore no point in repeatedly executing a query on Cloud Spanner to check whether a connection is valid or not.
The
isValidmethod in a JDBC connection is used by connection pools to determine whether a connection is safe to hand out to an application. Executing a query each time for this is not very efficient for Cloud Spanner, as the Cloud Spanner JDBC connection is just a wrapper around the client library, and does not implement a physical connection with Cloud Spanner. This means that loss of network connectivity is 'all-or-nothing'; if the network connection to Cloud Spanner has been lost, then it will apply to all JDBC connections, and not only a specific one. There is therefore no point in repeatedly executing a query on Cloud Spanner to check whether a connection is valid or not.