On Apr 13, 2008, at 3:01 AM, Tomas Lee wrote: > On 2008 April 12 (Sat) 05:44:53pm PDT, Shawn Wilsher <[EMAIL PROTECTED] > > wrote: >> When using SQLite 3.5.4.1 (a special branch cut for Mozilla, based >> mostly off of 3.5.4 with some OS/2 fixes), I'm getting SQLITE_LOCKED >> returned unexpectedly. The documentation seems to indicate that I >> should only be getting SQLITE_LOCKED if I'm calling sqlite3_exec >> recursively writing to the same table. However, it seems to me that >> I'm having that happen when two different threads are trying to write >> to the same table. I would expect to get SQLITE_BUSY at this point, >> but perhaps I'm misusing the API or have the wrong expectations. >> >> This is happening by using a different sqlite3 database pointers, one >> for each thread. > > Are you using a shared cache? You can get also get SQLITE_LOCKED when > using a shared cache. See section 2.2 of > <http://www.sqlite.org/sharedcache.html>. > > I've not used a shared cache myself. One day I was wondering if I > needed to worry about handling SQLITE_LOCKED errors and I came across > that page. Are these the only times you can get SQLITE_LOCKED errors?
If you are in the middle of a SELECT statement and from the same database connection you try to DROP one of the tables that is being read, the DROP statement will return SQLITE_LOCKED. D. Richard Hipp [EMAIL PROTECTED] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users