> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# pg-advisory-lock-session

> A PostgreSQL session can return to the pool while it holds an advisory lock.

## What it flags

A recognizable session advisory lock in `pg.Pool.query()`, or an ordinary release of a visible local checkout that still holds a session advisory lock.

## How to review or fix

Run the protected work on one checked-out client. Unlock on that client before releasing it and discard the connection when cleanup fails. Transaction-scoped advisory locks have a separate lifetime tied to the transaction.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "pg-advisory-lock-session": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.