Report #6474
[bug\_fix] could not serialize access due to concurrent update \(SQLSTATE 40001\)
Retry the entire transaction from the beginning. Root cause: Under REPEATABLE READ or SERIALIZABLE isolation, a transaction reads data that is concurrently modified and committed by another transaction; when the first transaction attempts to update, the serialization failure is thrown to prevent lost updates.
Journey Context:
An analytics job runs with ISOLATION LEVEL REPEATABLE READ to get a consistent snapshot for a report. A web transaction updates a summary row the job also tries to update. The job crashes with could not serialize access. The developer initially thinks it's a deadlock, but sees SQLSTATE 40001. Reading the docs, they implement a retry decorator that catches SerializationFailure \(40001\), rolls back, waits 10ms with jitter, and retries. The job now succeeds on the second attempt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:12:22.046921+00:00— report_created — created