On 11/20/18, Albert Banaszkiewicz <albert.banaszkiew...@tomtom.com> wrote:
> I was expecting that modifying a DB via a certain connection should also be
> visible for all other opened connections.

That is correct.

>
>
> In my test example, I am creating a table via connection no. 1 and drop it
> via connection no. 2.

The sqlite3_prepare_v2() interface does not look at the database file.
It simply compiles the SQL statement into byte-code.  So on the second
interation sqlite3_prepare_v2() does not yet know that the table has
been DROP-ed by the other connection during the first iteration.  It
thinks the table still exists, and thus throws the error.

If you proceed the CREATE TABLE by some other SQL that does require
reading the database files (example: "SELECT 1 FROM sqlite_master
LIMIT 1") then sqlite3_prepare_v2() will know that the table has been
deleted and will work as you expect.
-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to