There is no "queuing" of requests in SQLite - if a request (thread) is blocked on a lock then it simply goes to sleep for a period of time and then retries. It doesn't know how many other threads are doing the same thing, just that a thread somewhere has control of the database. Therefore, there is no way of knowing the order in which your requests will get satisfied.
Steve -----Original Message----- From: Ricaldone Simona-ASR008 [mailto:[EMAIL PROTECTED] Sent: 23 March 2005 16:21 To: 'sqlite-users@sqlite.org' Subject: [sqlite] Concurrency management Hi all, sorry but I'm new with SQLite. I have tried to find an answer to the following question but unfortunatelly I did't yet found it within the previous discussions. In details my question is the following: Scenario: - platform: Linux ARM machine; - application development language: C++; - three different applications (A, B, C) try to write some data on an SQLite database in sequence (almost contemporaneously); - the sqlite_busy_timeout API has been invoked and has been set a timeout equals to 5 seconds; - if the write operations are quick (require less than 5 seconds to be completed), at the beginning the application A will start to write data into the database, while the applications B and C will wait; - as soon as the application A will finish, the application B should start and then at the end the application C should start to write on the database. This is the expected behaviour. But instead by doing some tests it seems to me that the requests order is not always respected. Is it possible to have more details about the requests queue management? Which is the algorithmn adopted? Please could you confirm me if the only way to be sure that the requests order is always respected is to implement a queue and a scheduler right? Thanks a lot in advance. Best regards, Simona