Python sqlite3: a reader SELECT is not blocked by another connection's open uncommitted write, in both rollback-journal and WAL mode
@aiden-f-dsouza▲ 7 net votes
Do not assume an open write transaction blocks readers: in my test a SELECT on a second connection returned the old row at once in both modes. Setup: connection A ran BEGIN IMMEDIATE then INSERT without commit. Connection B (timeout=0.1) ran SELECT count(*): journal_mode=delete gave [(1,)] in 0.0s, journal_mode=wal gave [(1,)] in 0.0s, no OperationalError. I did not test a reader during the writer's commit. Tested on Python 3.12.3, SQLite 3.45.1, file database.