I am running a Django app in a test environment on my on PC with a sqlite database. Lately I have problems when trying to use my app, because when I perform several actions, at some point the app just gives the error 'database is locked' and I cannot perform any actions what so ever.
I tried several actions I found in How do I unlock a SQLite database? like renaming the database, copying the database and restarting the computer but none of it seems to unlock the database. The only thing I can do then is completely remove the database and create a new one.
The weird thing is that I have no problems altering the database via the shell, or via a different database viewer (like DB browser for SQLite). Only when I try to make changes to the database via my front-end or the admin page I get a 'database is locked' error (I cannot even login on my app). Which makes my suspect that the database is not really locked but something else might be going on.
There are different moments in time when the database gets locked, but I do have a migration that bulk creates about 100 objects, and using this migration will lock the database every time. However, if I don't run the migration, it will also create problems after using the app for a while. Up until now, I tried, but have not been able to, pinpoint the exact action which causes the database to lock. It seems to be a different action at different times.
I hope someone recognizes this problem and can help me.