Hi Dennis, Thank you for your reply :)
I'm using SQLite in .NET through Finisar.SQLite wrapper. The locking mechanism is a static object which I use as a mutex by the .NET 'lock'-method. And finally - yes, I open and close the database in each transaction: Regarding the API that returns the error - then it's sqlite3_exec (followed by a call to sqlite3_errcode which actually detects the problem). I have used the .NET library and the locking mechanism before - but without the transactions - without any serious problems. However, then some of the INSERTs / UPDATEs wasn't committed correctly, and transactions was lost. The problem also seems to appear primarely when the machine is heavily loaded with other jobs, especially I/O - however this is not always the case. We have recently double the RAM in the machine which almost eliminated the disk queue - but the problem with SQLite continues. -----Original Message----- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: 8. maj 2006 17:12 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Transactions and 'library routine called out of sequence' locks the database Michael B. Hansen wrote: > I use my own global locking-mechanism, so only one connection can be > opened at one time. > Michael, Is it possible that your "own" locking mechanism is failing? You haven't said how the locks are implemented, and getting mutual exclusion stuff right in roll your own code can be very difficult. The way you have worded the above it sounds like you are opening a database connection for each transaction (as opposed to using a global connection to execute each transaction). Is that true? Which API function is returning the error? Dennis Cote