Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prisma Connection Pool #237

Open
MarwanRadwan7 opened this issue Oct 29, 2023 · 0 comments
Open

Prisma Connection Pool #237

MarwanRadwan7 opened this issue Oct 29, 2023 · 0 comments
Assignees
Labels
🐞 Bug Something isn't working

Comments

@MarwanRadwan7
Copy link

Describe the Bug (버그 설명)

Creating a new instances of PrismaClient each time with its own connection pool is not efficient in production applications. As for every new instance you make a new connection on the database pool.

Version to Reproduce (현재 사용한 버전)

Version: 10.2.1

Steps to Reproduce (재현 순서)

  1. Go to middlewares, constrollers and services directory
  2. Click on '....'
  3. Scroll down to public users = new PrismaClient().user;
  4. See error

Expected Behavior (예상 동작)

Heavy load on the database.

Solution:

Using some kind of singleton instead so it uses the same instance for all of these.

@MarwanRadwan7 MarwanRadwan7 added the 🐞 Bug Something isn't working label Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants