On 7/25/06, Ralf Deininger <[EMAIL PROTECTED]> wrote:

I have a multi-threaded application. Each thread has its own database
connection. One of the thread changes the schema of the database (DROP
TABLE, CREATE TABLE). I have observed that the other threads do not know
about these modifications since queries for the new/altered table doesn't
return the expected results.

You are not checking the return codes because you should have received
a SQLITE_SCHEMA_CHANGED (or whatever the error code is).

If you are not receiving this, then it's either a bug in sqlite or in your code.

It looks like the schema is cached by the connection. Can anybody confirm
this? How can I efficiently refresh the cache, or do I have to close and
reopen the database connection?

You need to "re-prepare" all your pre-compiled statements after you
receive the error.

Maybe you are using some wrapper around the sqlite API that is missing this?


Regards,
~Nuno Lucas


-Ralf


Reply via email to