I'm programming an C# application with a SQLite database, I get the message: Database Locked(5) in my output log sometimes. I don't want that to happen, I know that multiple actions performed to my database give me this exception.
Question:
Is there a way to see if the SQLiteDatabase is busy processing other queries?
If you're creating a multithreaded application, having the knowledge you ask for will not solve any problems. They might make them appear less often, but occasionally you will see the same problem as before.
Why? Because from the instant where you ask "are you locked?" to the instant where you say "in that case, let me lock you to do something", another thread might have jumped in and locked it.
Unless you get a timeout, I would handle the exceptions and determine in each case what to do.
Additionally, since SQLite is inherently a single-user (and not user as in person, but user as in "something that uses the database") database, you might consider that this is not growing to be the wrong tool for the job.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With