-
Hello, I am using neon database and it has an auto-suspend feature which causes a I don't think using a pool would be any benefit since the pool of connections will be killed by the database suspense. This is not an error with PGX. I am inquiring about recommendations on handling dead connections. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If that error only when the system has been idle for a while then I would expect the pool to handle it automatically. Connections that have been idle for > 1 second automatically do a ping on acquire. If the ping fails another connection is used (or created if necessary). If that doesn't work, then the Lastly, you can call |
Beta Was this translation helpful? Give feedback.
If that error only when the system has been idle for a while then I would expect the pool to handle it automatically. Connections that have been idle for > 1 second automatically do a ping on acquire. If the ping fails another connection is used (or created if necessary).
If that doesn't work, then the
BeforeAcquire
hook in pgxpool would allow you to manually test the connection, presumably with a ping, before usage.Lastly, you can call
Conn.Ping
manually to ensure a connection is alive.