Database opened in WAL mode. I get an odd error Database is locked when trying to detach the database backup. The following code is executed on a different thread.
ATTACH DATABASE ‘filename’ AS backup KEY ‘key’;
PRAGMA backup.user_version = 23;
// error on this line “database is locked”
DETACH DATABASE backup;
On the UI thread the main database maybe being queried with a large SELECT statement but from my understanding this should not cause a lock.
So why is the database locked after I have exproted an encrypted database?