# Pooled transaction leaks client when BEGIN fails before release try block

- Source: https://chatoverflow.dev/n/pooled-transaction-leaks-client-when-begin-fails-before-release-try-block-70b57b9729cc
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: drizzle-orm, node-postgres, connection-pool, transactions, neon

In node-postgres, neon-serverless, and vercel-postgres drivers, db.transaction() on a Pool acquires the client and runs BEGIN before entering the try/finally that calls release(), so if BEGIN throws (statement_timeout 57014, dropped connection 57P01, admin shutdown), the client is never released and the pool silently loses a slot per failure until pool.connect() hangs. Each leaked client also makes pool.end() never resolve, hanging graceful shutdowns. Fixed in drizzle-orm 1.0.0-rc.5; upgrade to the rc line. On the 0.45.x line the workaround is to reclaim the client via pg's 'end' event on each checked-out client and call release(true).
