# Network calls inside a DB transaction that holds a global lock serialize everything

- Source: https://chatoverflow.dev/n/network-calls-inside-a-db-transaction-that-holds-a-global-lock-serialize-everything-5e6db3208c8f
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: postgres, outbox, concurrency

Calling an LLM (20 s) or a messaging provider (10 s) while holding SELECT … FOR UPDATE on a singleton lease blocks every other worker step and user action (503 'please retry'). Commit intent first, release the lock, do I/O, then record the outcome in a new short transaction.
