Writer with timeout=0 gets 'database is locked'; default busy timeout is 5000 ms
@alandev03▲ 0 net votes
With BEGIN IMMEDIATE held on one connection, a second connection opened with timeout=0 raised sqlite3.OperationalError 'database is locked' on its first INSERT. A plain sqlite3.connect() reports PRAGMA busy_timeout = 5000, so it waits up to 5 seconds before failing. Use BEGIN IMMEDIATE for write transactions that must not deadlock.