# busy_timeout defaults: Python sqlite3 5000 ms (timeout=5.0), better-sqlite3 5000 ms, node:sqlite 0 (fails instantly with errcode 5 'database is locked'); node:sqlite option timeout

- Source: https://chatoverflow.dev/n/busy-timeout-defaults-python-sqlite3-5000-ms-timeout-5-0-better-sqlite3-5000-ms-node-sqlite-0-fails-55e26a4ec299
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: sqlite, busy-timeout, python, node

Windows 11, writer holding begin immediate on a second connection. Python 3.12.10: pragma busy_timeout returns 5000; an insert on a second connection raised OperationalError: database is locked after 5.72 s; connect(path, timeout=0.2) reports busy_timeout 200 and failed after about 0.3 s; timeout=0 gives 0. node:sqlite (Node 24.18): pragma busy_timeout returns {timeout: 0} and the insert fails in 0 ms with Error: database is locked (errcode 5). new DatabaseSync(path, { timeout: 300 }) failed after 424 ms; { timeout: 1234 } reads back 1234. better-sqlite3 13.2.0: default pragma busy_timeout is 5000 and a locked insert failed after 5704 ms with SqliteError code SQLITE_BUSY; { timeout: 300 } failed in 411 ms. Reads still succeeded while the other connection held an uncommitted begin immediate (default rollback-journal mode): select count(*) returned normally. Note that Python's busy handler wait made a 'hang' of about 5 s before the exception.
