Bolt database

Database Connection Leak - Connections Never Close

Database connections accumulate over time. Pool reaches max connections and new queries fail. Eventually app becomes completely unresponsive.

Connection count grows with each request and never decreases.

Error Messages You Might See

Error: too many connections Error: no more connections available Connection pool exhausted Connection not returned to pool
Error: too many connectionsError: no more connections availableConnection pool exhaustedConnection not returned to pool

Common Causes

  1. Not awaiting database queries properly
  2. Promise not being resolved/rejected
  3. Connection created but not returned to pool
  4. Long-running queries holding connections indefinitely
  5. Error in query handler not releasing connection

How to Fix It

Always await database calls: await prisma.user.findUnique(...)

Use try/finally to ensure cleanup: try { await db.query(...) } finally { await client.release() }

Set query timeout: Prisma has built-in, use setTimeout for others

Check connection pool size: should be reasonable for concurrent users

Monitor connections: SELECT count(*) FROM pg_stat_activity in PostgreSQL

Real developers can help you.

Caio Rodrigues Caio Rodrigues I'm a full-stack developer focused on building practical and scalable web applications. My main experience is with **React, TypeScript, and modern frontend architectures**, where I prioritize clean code, component reusability, and maintainable project structures. I have strong experience working with **dynamic forms, state management (Redux / React Hook Form), and complex data-driven interfaces**. I enjoy solving real-world problems by turning ideas into reliable software that companies can actually use in their daily operations. Beyond coding, I care about **software quality and architecture**, following best practices for componentization, code organization, and performance optimization. I'm also comfortable working across the stack when needed, integrating APIs, handling business logic, and helping transform prototypes into production-ready systems. My goal is always to deliver solutions that are **simple, efficient, and genuinely useful for the people using them.** BurnHavoc BurnHavoc Been around fixing other peoples code for 20 years. Matthew Butler Matthew Butler Systems Development Engineer @ Amazon Web Services Pratik Pratik SWE with 15+ years of experience building and maintaining web apps and extensive BE infrastructure Meïr Ankri Meïr Ankri Full-stack developer specializing in React / Next.js / Node.js with 6+ years of experience. I've worked across various sectors including automotive (Reezocar/Société Générale), healthcare (Medical Link SaaS), and e-commerce (Glasman). I build web apps end-to-end, from architecture to production, with a focus on scalability, performance, and code quality. I also mentor junior developers and contribute to technical decisions and code reviews. MFox MFox Full-stack professional senior engineer (15+years). Extensive experience in software development, qa, and IP networking. Anthony Akpan Anthony Akpan Developer with 8 years of experience building softwares fro startups Matthew Jordan Matthew Jordan I've been working at a large software company named Kainos for 2 years, and mainly specialise in Platform Engineering. I regularly enjoy working on software products outside of work, and I'm a huge fan of game development using Unity. I personally enjoy Python & C# in my spare time, but I also specialise in multiple different platform-related technologies from my day job. Jaime Orts-Caroff Jaime Orts-Caroff I'm a Senior Android developer, open to work in various fields Stanislav Prigodich Stanislav Prigodich 15+ years building iOS and web apps at startups and enterprise companies. I want to use that experience to help builders ship real products - when something breaks, I'm here to fix it.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

How do I check active connections?

PostgreSQL: SELECT count(*) FROM pg_stat_activity. Should be < max_connections setting

What's a good connection pool size?

Prisma default is 5. Increase for more concurrent users, but don't exceed database limit

Why do connections leak?

Not awaiting promise, error thrown before release, or forgetting to return connection to pool

Related Bolt Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help