On 7 Feb 2014, at 10:44pm, Tim Streater <t...@clothears.org.uk> wrote:

> Now I'm finding that sometimes the "processing results here" can take a 
> minute or so, as it involves reading a file from disk and sending it to a 
> remote host. Instead of twiddling my thumbs waiting for this, I'm initiating 
> another action which inter alia involves doing an insert into mytable in 
> mydb, and yes, it gets "database is locked".
> 
> A simple way to fix this is to read the results into arrays in my loop above 
> (should be quick, rarely more than 10 rows), drop the database, and then have 
> a second loop to use the results, i.e. move "process results here" into the 
> second loop.

You don't seem to be calling ->finalize() on your result.

> But can I instead move setting the handle to null right after the query? Or 
> does that lose me the result set?

You should not be manually setting any handle to null.  Try calling 
->finalize() on the statement and eventually ->close() on the database, which 
do more than just setting their value.  If you are setting anything to null 
manually, this may be causing the problem you report.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to