Server has closed the connection
Thank you for your continued support.
I am having trouble with “server has closed the connection.”
Prisma does not perform a connection health check after creating a connection, right?
If the socket is closed due to TCP Idle Timeout in the network configuration or OS, rather than in the application or Prisma client, Prisma client will continue to hold the connection.
As a result, an error “server has closed the connection” occurs when executing a query, and the query cannot be executed.
Question
- Is there a way to periodically check if the connection is available on the Prisma client side? Something like this (https://github.com/prisma/prisma/issues/13264#issuecomment-1633258460)
- Is query retry processing necessary in this case? Like this (https://github.com/prisma/prisma/discussions/24490#discussioncomment-9743866)
The actual flow is as follows.
Thank you.
I am having trouble with “server has closed the connection.”
Prisma does not perform a connection health check after creating a connection, right?
If the socket is closed due to TCP Idle Timeout in the network configuration or OS, rather than in the application or Prisma client, Prisma client will continue to hold the connection.
As a result, an error “server has closed the connection” occurs when executing a query, and the query cannot be executed.
Question
- Is there a way to periodically check if the connection is available on the Prisma client side? Something like this (https://github.com/prisma/prisma/issues/13264#issuecomment-1633258460)
- Is query retry processing necessary in this case? Like this (https://github.com/prisma/prisma/discussions/24490#discussioncomment-9743866)
The actual flow is as follows.
Thank you.
GitHub
Problem I need to check if the app is still connected to the DB. The solution must be universal for every database. Suggested solution Enable the "provider" field as a public (or getProvi...
GitHub
Question Possibly related to this issue, but I'm confused as to how applications are supposed to gracefully handle transient DB connection errors due to things like database/pgbouncer restarts....