[elephant-devel] sqlite backend, "Error 5 / database is locke

read at robertlread.net read at robertlread.net
Thu Aug 2 23:21:23 UTC 2007


Forgive me taking a long time to answer this; I have been on traveling.

Here is the comment that I wrote into the sql-controller.lisp file, more than a year ago, I guess:

;; Every actual CL-SQL connection has to be in a separate thread.
;; My solution to this is to keep a map of threads, and reuse connections within a certain thread.

That is, CL-SQL itself is threadsafe if you use a separate connection in each thread.  You have to 
provide a mutex so that multiple threads don't access the same connection simultaneously.
As far as I know, this all functions correctly in Elephant and the user doesn't have to worry about 
it at all; certainly my own application is multi-threaded and I have not noticed a problem, although
that is not a very good stress test.

However, I think I am agreeing with the author in saying that the problem could well be inside
SQLite3 itself.

My memory of all of this stuff is a little rusty; I personally am not sure how robust SQLite is in
a multi-threaded environment.





More information about the elephant-devel mailing list