# Postgres error 40001: could not serialize access due to concurrent update

> A serialization failure: under REPEATABLE READ or SERIALIZABLE isolation, this transaction conflicted with another and was rolled back.

Source: https://scribase.com/postgres-errors/40001

SQLSTATE class: Transaction Rollback. Over PostgREST/supabase-js this maps to HTTP 500.

## Causes

- Two transactions read and then wrote overlapping data under a strict isolation level.
- Hot rows (counters, balances) updated by many transactions at once.

## Fixes

- Retry the whole transaction. This error is designed to be retried; wrap the transaction in a retry loop with a small random backoff.
- Keep transactions short and touch hot rows last.
- If you do not need strict isolation for that work, use the default READ COMMITTED.