[Mono-list] Mono.Data.SqliteClient.SqliteSyntaxException: database is locked
Manish Rai Jain
manishrjain at gmail.com
Tue Jun 19 12:09:45 EDT 2007
My application is utilizing sqlite as the backend. I'm using the
libmono-sqlite library which comes with Ubuntu, the version as reported is
2.0. The connection setting is set as "URI=file:/../sqlite.db,version=3". My
application is a GUI application, with one extra thread than the
Gtk.application main thread. This thread tries to communicate with online
server, and update the records in the database. I've couple of tables inside
the single database. Initially I had opened up a single connection, and was
doing updates/selects through that. I ended up with "library sequence out of
error" exceptions. So, I modified the code such that each query will open up
new connection, and then run itself. So, "library sequence" exceptions went
away, but got overtaken by "database locked" ones. So, to do synchronization
at the application level, I've set the C# locking mechanism to such that
1. each table only runs one query at a time, and
2. only one write query is being run at a time.
However, all this has done is just to _reduce_ the number of database locked
exceptions. I'm still getting them. Is there a way by which they can be
eliminated? Mono database page shows that we can use the new library
System.Data.Sqlite, which is version 3 and apparently doesn't have these
synchronization issues. However, I've been unable to find the .dll for
linux. Any help is appreciated.
Thanks
Manish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20070620/00320812/attachment.html
More information about the Mono-list
mailing list