Synthetic fixtures computed locally. No model or production service is contacted.
Experiment workspace
Decision trace
The question this experiment answers
Two connections, A and B, share one SQLite file with a stock row that starts at 5. Each UPDATE subtracts one. Given a timeline of statements, which ones succeed, which wait for the busy timeout, and which fail with SQLITE_BUSY at once even though a timeout is set? Choose the journal mode and the busy timeout, then edit the timeline.
Change one assumption at a time
Start from a preset and change one thing. Switch the both-read-then-write preset from BEGIN to BEGIN IMMEDIATE on both connections, or from the rollback journal to WAL. In the timeout presets, change the busy timeout or the time of A's COMMIT. Timeline lines have the form 300 A UPDATE: the time in milliseconds, the connection and one of BEGIN, BEGIN IMMEDIATE, SELECT, UPDATE, COMMIT and ROLLBACK.
Expected outcomes
Both read, then both write: A's UPDATE fails with SQLITE_BUSY after 0 ms in both journal modes and the final stock is 4. BEGIN IMMEDIATE on both: B waits 500 ms, no errors, final stock 3. Another commit after a WAL read: SQLITE_BUSY_SNAPSHOT at once. A writer holding the lock past a 1,000 ms timeout: B fails after waiting 1,000 ms. A writer finishing at 900 ms: B waits 800 ms and succeeds. A rollback-journal COMMIT waits 1,000 ms for an open reader. All seven presets were checked against SQLite 3.49.1 from CPython 3.13.5.
Read the table and the trace
The table lists every statement in the order it completed, with its result and how long it waited. A busy error with a wait of 0 is the case the busy timeout cannot help: the connection already held a read transaction and asked to write. The trace explains each result and ends with the final stock and the error counts.
Reset and export
Reset inputs restores the selected preset and recomputes. Export JSON downloads the inputs, every statement row, the metrics, the trace and the stated limits, so a timeline from an incident can be kept with the decision to change a BEGIN.
Limits
A 1 ms tick model of two connections and one row, not SQLite itself. Within one tick connection A acts before B, and statements of one connection run at least 1 ms apart. Checkpoints, shared-cache mode, EXCLUSIVE transactions and file-system differences are not modelled. Timelines other than the presets are model predictions; the companion example can run any timeline against real SQLite.