The database file is locked
Posted: Wed 22 Jun 2011 15:02
I am using the Devart SQLite provider in a situation where a single SQLite database is being accessed from multiple processes. I will occasionally get an exception with the message "The database file is locked" when reading/writing from the database.
Is there any way to control the behavior of the SQLiteCommand object such that it will retry the command until a specified timeout is reached? I thought that the CommandTimeout property would do this, but it doesn't seem to have any effect as the command throws the exception immediately.
If there is no mechanism in place to allow this then would you consider enhancing the provider to allow access to the sqlite3_busy_handler() or sqlite3_busy_timeout() functions provided by the sqlite engine?
Is there any way to control the behavior of the SQLiteCommand object such that it will retry the command until a specified timeout is reached? I thought that the CommandTimeout property would do this, but it doesn't seem to have any effect as the command throws the exception immediately.
If there is no mechanism in place to allow this then would you consider enhancing the provider to allow access to the sqlite3_busy_handler() or sqlite3_busy_timeout() functions provided by the sqlite engine?