databricks-sql-go
databricks-sql-go copied to clipboard
Avoid session idle timeouts
Sessions time out. And a connection is associated with a session. If the user does not set max connection idle timeout, it is possible that they'll get errors on session timeout.
We need to either have a heartbeat, or figure out a way to invalidate the session and create a new one. Or as a last resort gracefully handle the error.
Any updates on this one please?
Sorry for the delay. There were many discussions on how to deal with this and heartbeats have many drawbacks. SQL Warehouses now have a 8 hour session idle timeout, so this should not be a real issue. Is the concern now primarily related to clusters?
In my case, I have a web app that works with DataBricks and was wondering what would be the best way to handle session timeouts without restarting the server
databricks: execution error: failed to execute query: Invalid SessionHandle
No worries, thanks for the reply.
My issue is similar to @cghiban, I have an app that uses the warehouse so I have to restart it every now and again in order to refresh the session.
oh, in your case, please set https://pkg.go.dev/database/sql#DB.SetConnMaxIdleTime
This will prevent the issue you're having. No need to restart the pod