Errors with transaction
Hi, i've facing a lot of prisma errors with transactions and connection pool.
My environment is:
- PostgreSQL on GCP, connection string parameters: ?connection_limit=50&pool_timeout=20
- Default connection with prisma client.
- 800 connections limit on PostgreSQL
Errors that i'm receveing:
- Invalid
prisma.machine.findUnique()
invocation:
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 3)
- Transaction API error: Transaction already closed: A commit cannot be executed on an expired transaction. The timeout for this transaction was 20000 ms, however 115225 ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction.Connection pool | Prisma Documentation
Prisma ORM's query engine creates a connection pool to store and manage database connections.
5 Replies
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the
#ask-ai
channel awaits if you're curious!Based on the error message it seems that the connection limit is 3 and not 50, due to which you are running out of connections
But my connection string is set to 50
Strange! Can you see the number of connections being used in GCP Console?
Are you using the latest prisma version 6.14.0?
I will try somehow to get this number