Thanks for the help, I have found the problem, it lies very deep in some query code which gives up reading new rows and never returns the read lock, was not easy to spot.
Owen On 10 July 2013 12:42, Simon Slavin <[email protected]> wrote: > > On 10 Jul 2013, at 12:28pm, Owen Haynes <[email protected]> wrote: > > > I only call sqlite3_finalize() when the thread has finished with the > > connection, which is when the thread is deleted. sqlite3_reset is used > on B > > after it it been notified, and when a query is a success. It looks like B > > returns a code 100 in the step function sometimes, should I do > > something different with this code? > > http://www.sqlite.org/c3ref/c_abort.html > > "#define SQLITE_ROW 100 /* sqlite3_step() has another row ready > */" > > In other words, your query has another row of data ready for you to ask it > about. > > > When it is returned with this code it seems to not go into > > sqlite3ConnectionUnlocked. > > Well naturally. Your query has not finished returning results. The file > has to remain locked until /all/ results have been returned. For all you > know there are another hundred rows of data to be read before the query has > finished executing. > > The expected results from sqlite_step() are as follows: > > SQLITE_ROW — a row of data has been assembled for you to ask about > > SQLITE_DONE — no errors have occurred and there are no more results from > that query. Now is a good time to do a _reset() or a _finalize() > > anything else — some sort of error has occurred and must be handled > according to the result code > > Simon. > _______________________________________________ > sqlite-users mailing list > [email protected] > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

