SQLITE_BUSY on database access

(Skip to last sentence for question without context)

I recently updated to 2.1.35 (84dcaa86), from some earlier version of I believe 2.1. I am using external code to read the .anki2 file (only read) for detailed information on the cards (I haven’t found a way to distinguish between unseen and learning on the first day using only AnkiConnect) and external processing (for tracking for lessons I have).

While using this new version, if Anki is being used, it acquires a SQLite lock, so I will get an error in the external application:
“[SQLITE_BUSY] The database file is locked (database is locked)”

I am also using AnkiConnect, so I have to keep Anki running while the code is running.

All in all, what I want to ask is:
Could the code be modified to execute a SQL query “pragma journal_mode=wal” so that external programs can read the database (not write) it safely while Anki is running?

Anki does not expect the database to be accessed externally while it is running. You’ll either need to close Anki first, or create a copy of the DB to work with.

I just created a copy of the file to work with. Thank you, problem solved! :slight_smile: