The database file is locked

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
mjegen
Posts: 5
Joined: Wed 22 Jun 2011 14:46

The database file is locked

Post by mjegen » 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?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 23 Jun 2011 08:30

We will investigate the possibility to work with the same database file from multiple processes and post here about the results. You can work with one database from multiple threads within one process at the moment: http://www.devart.com/forums/viewtopic.php?t=20669.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 07 Jul 2011 11:55

The Busy Timeout (in milliseconds) connection string parameter for control of access to database from multiple processes is implemented. I will post here when the corresponding build of dotConnect for SQLite is available for download.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 29 Jul 2011 07:27

New build of dotConnect for SQLite 3.30.196 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/sqlite/download.html (trial version) or from Registered Users' Area (for users with valid subscription only): http://secure.devart.com/ .
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=21608 .

Post Reply