This question seems to come up often, and I'm still confused as to
what problems people are having.  What APIs are you using to perform
these steps?  In particular, when you want to update a row, are you
using a prepared query that is executed multiple times, or are you
creating an SQL statement and executing that with sqlite3_exec?  Are you
using 2.8 or 3.x?  Maybe the confusion on my part is due to different
database versions.

   I'm confused as to why executing a query would lock the database.
The only thing I can think of is that the query required a temp table,
and the creation of that temp table led to the database being locked.
The entire many readers/single writer concept makes no sense if
executing any query locks the whole database.

   -Tom

> -----Original Message-----
> From: Thomas Fjellstrom [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, May 12, 2005 7:10 AM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] database table is locked
> 
> On May 12, 2005 04:59 am, Martin Engelschalk wrote:
> > Hello,
> >
> > i open cursor on a table and retrieve rows from it.
> > For every row i decide whether to update it.  However, when 
> executing
> > the update I get the error "database table is locked".
> > My application is the only one working on the table.
> > Is it illegal to update a table while selecting from it or 
> am i doing
> > somethin wrong?
> >
> > Thanks,
> > Martin
> 
> Yup. you'll have to scan for updates to make, then after the 
> scan, make the 
> updates.
> 
> -- 
> Thomas Fjellstrom
> [EMAIL PROTECTED]
> 

Reply via email to