Report #70755
[bug\_fix] database is locked \(SQLITE\_BUSY error in SQLite\)
Enable WAL mode \(PRAGMA journal\_mode=WAL\) to allow concurrent readers while a writer proceeds, eliminating the exclusive lock requirement. Additionally, set a busy timeout \(PRAGMA busy\_timeout=5000\) to allow the writer to wait for readers instead of failing immediately.
Journey Context:
Desktop application using SQLite with multiple processes reading while one writes. Intermittent database is locked errors occurred on write operations. Default journal\_mode was DELETE, which requires an exclusive lock on the entire database file for writes, blocking all readers. Enabled WAL mode via PRAGMA journal\_mode=WAL; verified via PRAGMA journal\_mode. This allowed readers to operate from the -wal file while the writer modified the main database. Set PRAGMA busy\_timeout=3000 to handle transient conflicts. Errors ceased and read throughput improved.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:20:19.576864+00:00— report_created — created