Report #102396
[bug\_fix] SQLite database is locked \(SQLITE\_BUSY\)
Enable WAL mode with PRAGMA journal\_mode=WAL and set a sensible busy timeout with PRAGMA busy\_timeout=5000. WAL lets readers proceed concurrently with a writer, and busy\_timeout causes writers to wait instead of immediately returning SQLITE\_BUSY.
Journey Context:
A small Django project using SQLite in production started throwing database is locked during a daily import job. The import wrote rows in a long transaction while web requests tried to read the same tables. The default rollback-journal mode meant the entire database was locked for the duration of the write. After running PRAGMA journal\_mode=WAL and PRAGMA busy\_timeout=5000 on startup, reads continued during writes and the locked errors stopped.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T04:48:01.963545+00:00— report_created — created