# X_REPO_CLIENT_PINNED

## Means

a repository pinned to its own client cannot join the open transaction

## Typical cause

a repository built through `postgresDriver({ client })` used inside a transaction that was opened on **another** client. Refused rather than resolved: the pinned client takes a different connection out of its pool, so the write commits immediately and survives the rollback while the read cannot see rows the transaction already wrote — both silently. A transaction opened **on** the pinned client (`withTransaction(fn, { client })`, `driver.transactor()`) is joined, `As of 2026-10-02` — `tx.origin` says it is the same database

## Fix

`setDbClient(client)` at boot and build the repository with no `client:` — `postgresDriver()` then resolves the open transaction through `db()` — or run this call outside `withTransaction()`

[Entity and database](/error-codes#entity-and-database)
