This has really got me confused. I looked at the locking docs on the sqlite 
website, searched the mailing list for answers, but nothing seems to match.

The error message I get says a table is locked, but the error id is just 
SQLITE_ERROR (0). I had initially figured it was because I didn't handle 
SQLITE_BUSY correctly (at all really), but now it should be "enough"...

I get the following debug info from my program:

erase
prepare: "BEGIN TRANSACTION;"
step: DONE
delete_key(14)
prepare: "SELECT id FROM conf_key WHERE parent_id=14;"
step: ROW
delete_key(15)
prepare: "SELECT id FROM conf_key WHERE parent_id=15;"
step: DONE
prepare: "DELETE FROM conf_key WHERE id=14;"
step: ERROR (1)
failed key: database table is locked
prepare: "ROLLBACK;"
step: ERROR (1)

Now, a little background, I use sqlite3 through a little C++ wrapper I wrote, 
and on top of that is a registry like config/settings api.

The text above starts with a call to ConfKey.erase() which goes and erases its 
key item, its children items, data items, and data_opt items (lets me specify 
the keys predefined allowable values)

It is possible for result items to sit around un finalized for a period, would 
that cause sqlite to keep a table locked?

At that point, the only "writing" being done is the deleting the keys above. 
all the other queries were all just SELECTS (and a BEGIN/COMMIT combo right 
at the start of my program)

Thanks :)

-- 
Thomas Fjellstrom
[EMAIL PROTECTED]
http://strangesoft.net

Reply via email to