SQLite Forum

Help to solve database locked
Login
>  How can I figure out which connection locked the database?

Since you are being precluded from obtaining a RESERVED lock, then the connection which holds a RESERVED lock is the one which is preventing a different connection from obtaining a RESERVED lock.

The solution would be to search the entire universe for connections to the database file and then on those connections find out which one of them is holding the lock.

Use the appropriate command for your Operating System to enumerate the processes which have the associated file open and go see which of those is holding the lock.  This requires information which you have not provided.