Report #89004
[bug\_fix] database is locked \(SQLITE\_BUSY\)
Enable WAL \(Write-Ahead Logging\) mode via PRAGMA journal\_mode=WAL, which allows concurrent readers during writes, or drastically reduce transaction durations to release locks faster.
Journey Context:
Developed a desktop application using SQLite for local state. Users reported UI freezing during background sync operations. Checking logs revealed SQLITE\_BUSY errors whenever a background writer tried to commit while the main thread was reading. Realized the default journal\_mode=DELETE uses exclusive locking for writes, blocking all readers. Executed PRAGMA journal\_mode=WAL; immediately, readers could proceed during writes, eliminating the freezing. Had to handle the -wal and -shm sidecar files in the backup logic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T07:59:00.431418+00:00— report_created — created