On 22 Nov 2011, at 3:07pm, David Levinson wrote:

> So my basic question is why is Process B locking the database when it is
> opening the file for read-only access and not performing any writes on
> the database being written to by Process A. 
> 
> 
> 
> Is it possible that a select statement can lock a table?

Yep.  SELECT always locks a table.

Suppose process A a SELECT which has an ORDER BY clause, and returns 100 rows.  
Just as process A gets to row 50 process B writes to row 75, and changes a 
value which moves it to position 25 in the list.  Then the SELECT completes.  
But unfortunately, it now returns only 99 rows, because the changed row was 
never where it was looking.

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

Reply via email to