[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] table locked?
From:       Thomas Fjellstrom <tfjellstrom () strangesoft ! net>
Date:       2004-12-31 17:11:36
Message-ID: 200412311011.36757.tfjellstrom () strangesoft ! net
[Download RAW message or body]

On December 31, 2004 06:37 am, D. Richard Hipp wrote:
> Thomas Fjellstrom wrote:
> > It is possible for result items to sit around un finalized for a period,
> > would that cause sqlite to keep a table locked?
>
> In version 3.0.5 and earlier, the commit did not occur until you
> ran sqlite3_finalize().  Beginning with version 3.0.6, the commit
> occurs on the last call to sqlite3_step() - the one that returns
> SQLITE_DONE.
>
> Even in version 3.0.8, if you have a query running on a table
> that has not yet returned SQLITE_DONE, then you are prohibited
> from making changes to that table.

So something as simple as: (riped out of delete_key())


MadSQLiteResult *res = conf->db->preparef("SELECT id FROM conf_key WHERE 
parent_id=%i;", kid);
if(!res)
 return false; 
while(res->step() == MadDB_ROW) {
 if(!delete_key(res->columnInt(0)))
  return false;
}
delete res;
conf->db->queryf("DELETE FROM conf_key WHERE id=%i", kid);

will fail? :(

Thanks, and sorry for the half written duplicate :(
-- 
Thomas Fjellstrom
tfjellstrom@strangesoft.net
http://strangesoft.net
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic