Hi Michael,

Michael Keilhofer wrote:

For sqlite 2.8 the documentation says that I can get a SQLITE_LOCKED when I try to execute a statement while in a callback function.

I'm not using callbacks but find that when I try to do an sqlite_exec() while iterating records using sqlite_compile() and sqlite_step() I still get the SQLITE_LOCKED even though the execute is on a tatally different table than was the query.

Can anyone tell me if this behavior is correct and if so, how do I update any table while reading records? e.g., To mark a record as being handled so another thread doesn't grab it.

It is never safe to use the same sqlite structure in the way you describe. That would be equivalent to using it from two different threads (if I am not mistaken), which is specifically warned against in the documentation.


The way to do it is probably to open the database twice, i.e., get two different sqlite structures.

HTH

Ulrik P.

--
Ulrik Petersen, MA, B.Sc.
University of Aalborg, Denmark





Reply via email to