Henrique Ramos
Henrique Ramos

Reputation: 786

Should i disconnect my prisma client after every query in NextJs?

Some months ago, I tried to do somethings with NextJs and mongoose, but I got a lot of problems about too many connections in my mongo database. I think the main problem was the NextJs way to do the things. Now Im learning about NextJs + Prisma with Postgresql, do i need end my connections when I end queries?

When i tried use mongoose, I create some cache for the database to not create a connection everytime, but the same thing kept happening: Too many connections. Its the same for prisma?

Upvotes: 0

Views: 2187

Answers (1)

DS Infinity
DS Infinity

Reputation: 26

With prisma it's possible to instantiate and not create many connections like shown here

hope this solves your problem

Upvotes: 1

Related Questions