How do I explicitly get a new connection from a pr...
# prisma-client
r
How do I explicitly get a new connection from a prisma object?
✅ 1
n
Prisma automatically manages the connection and gets a new connection if needed from the connection pool when a query is invoked so you don’t need to explicitly get a new connection, but if you want you can use the $connect method to get a new connection.
r
So if I call
$connect
twice, each object will have a different socket/session?
n
I am not sure if the PrismaClient will use a new connection when you call $connect a second time, If an existing connection is idle, then it should use the same connection. However, you can control the number of connections which PrismaClient is allowed to make through the connection_limit parameter, so technically if you have set connection_limit to 1 then even if you call $connect twice it would use the same connection.