On Tue, 08 Dec 2009 22:07:34 +0100, John Clayton <john_clay...@me.com> wrote:
>Hi > > I've got two processes opening up two sqlite databases. Assuming the > databases are called A and B respectively, then both processes do this: > using A, BEGIN IMMEDIATE > using B, BEGIN IMMEDIATE > ... do some stuff possibly involving A&B ... > using B, COMMIT > using A, COMMIT > > In a couple of cases, I've seen one of the processes get an exception > on COMMIT, the error is 'DB is locked'. I had thought that BEGIN > IMMEDIATE resulted in a write lock being taken out on the DB, and > therefore it should be possible to get a locking error on commit. > > Has anyone seen this kind of locking error or have > suggestions as to how I could track it down? First a few questions: - Which version of SQLite? - On what platform? - On what filesystem type is the database located? - Are any PRAGMA's used? - Do you use the sqlite3 C API, the sqlite3 command line tool, or some wrapper? - Did you access any other databases than A or B? You could try PRAGMA locking_mode=EXCLUSIVE or start your transaction with BEGIN EXCLUSIVE. >Thanks -- ( Kees Nuyt ) c[_] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users