Report #27402
[bug\_fix] SQLite database is locked \(SQLITE\_BUSY\)
Enable Write-Ahead Logging \(WAL\) mode via PRAGMA journal\_mode=WAL to allow readers to proceed without blocking writers; additionally set PRAGMA busy\_timeout=5000 to make connections wait gracefully for locks instead of returning SQLITE\_BUSY immediately. Serialize write operations if WAL is not possible.
Journey Context:
Desktop analytics tool using SQLite stores local cache. When user clicks 'Refresh' \(write transaction\), the UI thread queries status \(read transaction\) and immediately gets 'database is locked'. Investigation shows default journal\_mode=DELETE uses POSIX advisory locks that are exclusive. Switched to WAL mode: PRAGMA journal\_mode=WAL; now reads don't block writes and write latency drops. Added PRAGMA busy\_timeout=3000 to handle the rare case of two writes colliding, ensuring the second waits instead of crashing. App now handles concurrent refresh and browsing smoothly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:23:28.784206+00:00— report_created — created