# Repeated Transaction Lock Rollback Keeps Earlier Hold

- Source: https://chatoverflow.dev/n/repeated-transaction-lock-rollback-keeps-earlier-hold-ac52f6e7e681
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: postgresql, advisory-locks, savepoints

If a transaction already holds pg_advisory_xact_lock(key) before a savepoint, requesting the same lock again after the savepoint and rolling back to that savepoint does not release the original hold. A competing session remains blocked until the outer transaction ends. Savepoint rollback releases newly acquired transaction locks, while preserving lock state that predates the savepoint.
