---
source: https://iinventedlight.com/library/notes/sqlite-busy-and-locking.md
title: "SQLite locking and SQLITE_BUSY"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Public domain (sqlite.org); prose restates cited source lines"
attribution: "Summary by iinventedlight (AI-assisted). Sources: SQLite (sqlite.org), File Locking And Concurrency In SQLite Version 3, Public domain (sqlite.org); SQLite (sqlite.org), Result and Error Codes, Public domain (sqlite.org)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-04
as_of: 2026-11-04
confidence: medium
untested: "No code was run for this note; only the fetched documentation pages were read."
category: coding-references
topic_area: "code-ai-eng: SQLite"
tags: sqlite, locking, concurrency
sources:
  - id: S1
    title: "File Locking And Concurrency In SQLite Version 3"
    publisher: SQLite (sqlite.org)
    url: https://www.sqlite.org/lockingv3.html
    accessed: 2026-11-04
    license: "Public domain (sqlite.org)"
  - id: S2
    title: "Result and Error Codes"
    publisher: SQLite (sqlite.org)
    url: https://www.sqlite.org/rescode.html
    accessed: 2026-11-04
    license: "Public domain (sqlite.org)"
---
# SQLite locking and SQLITE_BUSY

## Short answer
SQLite allows many readers but only one writer at a time.

## Lock states
- **SHARED:** reading; many can coexist. [S1]
- **PENDING / EXCLUSIVE:** about to write / writing. [S1]

`SQLITE_BUSY` can occur at any point in a transaction. [S2]

## Claims
- id: C1
  claim: Multiple processes can hold SHARED locks at once.
  source: S1
  evidence: "processes can hold SHARED locks at the same time"
- id: C2
  claim: Only a single RESERVED lock may be active at one time.
  source: S1
  evidence: "Only a single RESERVED lock may be active at one"
- id: C3
  claim: SQLITE_BUSY means the database file could not be accessed due to locks.
  source: S2
  evidence: "The SQLITE_BUSY result code indicates that the database file could not"
- id: C4
  claim: SQLITE_BUSY can occur at any point in a transaction.
  source: S2
  evidence: "An SQLITE_BUSY error can occur at any point in a transaction"

## Sources
- [S1] File Locking And Concurrency In SQLite Version 3. SQLite (sqlite.org). https://www.sqlite.org/lockingv3.html . License: Public domain (sqlite.org). Accessed 2026-11-04.
- [S2] Result and Error Codes. SQLite (sqlite.org). https://www.sqlite.org/rescode.html . License: Public domain (sqlite.org). Accessed 2026-11-04.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
