go-sqlite3 icon indicating copy to clipboard operation
go-sqlite3 copied to clipboard

Error "database is locked" in wal mode

Open YanyunTao opened this issue 2 years ago • 1 comments

In WAL mode, one transaction continues to write to the SQLite database, and another transaction will report the error "database is locked" when creating, updating, and inserting data. Is this a WAL mode configuration problem?

YanyunTao avatar Dec 19 '23 01:12 YanyunTao

WAL doesn't allow concurrent writes. See section 2.2 concurrency, middle paragraph:

However, since there is only one WAL file, there can only be one writer at a time.

quarnster avatar Jan 09 '24 15:01 quarnster