Error code

SQLite SQLITE_LOCKED

SQLITESQLITE_LOCKED
Database Error Code· An error code returned by a database server such as PostgreSQL or MySQL.

What it means

a table in the database is locked — conflict within the same connection.

How to fix it

  1. Avoid reading from and writing to the same table in overlapping statements within one transaction.
  2. Complete or close any open read cursors before issuing a write.
  3. Use WAL journal mode which reduces intra-connection lock conflicts.

Not affiliated with SQLite. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.