Report #11932
[architecture] SQLite 'database is locked' errors under concurrent load
Enable Write-Ahead Logging \(WAL\) mode via \`PRAGMA journal\_mode=WAL;\`. This changes the locking model so that readers do not block the writer and the writer does not block readers, allowing one writer and multiple concurrent readers.
Journey Context:
SQLite's default DELETE journal mode locks the entire database file during writes, causing 'database is locked' exceptions when multiple connections \(e.g., web workers, concurrent requests\) try to access it simultaneously. WAL mode appends changes to a separate log file \(-wal\), allowing readers to access the last committed state from the main DB while the writer appends. This is essential for read-heavy web apps using SQLite \(e.g., Litestream, Edge functions\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T14:43:15.176921+00:00— report_created — created