On Wednesday, 30 October, 2019 16:33, mailing lists <mailingli...@skywind.eu> 
wrote:

>I face the following issue:

>1) SQLite has been compiled with SQLITE_THREADSAFE=1 and
>SQLITE_DEFAULT_SYNCHRONOUS=3
>2) I am opening in a thread a new database (standard journal mode) and
>creating some tables, indices etc. (explicit transaction)
>3) while creating the database a new database connection (read only) is
>established in another thread that tries to get some data by a prepared
>statement.

>In this second thread (step (3)) I get an SQLITE_ERROR in
>sqlite3_prepare. I actually expected an SQLITE_BUSY error. Remark: as
>step (2) is a transaction no tables exist when step (3) starts execution.

That is because your SQL statement has an error.  By the sounds of it the 
table(s) you are trying to query do not exist because you have not yet 
committed the transaction which is creating them.  

Key hints "new database" (contains nothing), creating tables etc in an explicit 
transaction, and while creating the database ... preparing a statement that 
reads the database fails with an error.

>Is my understanding correct that I only get an SQLITE_BUSY error when
>actually trying to run a query? In all other cases I should get different
>error codes, or?

Yes.

-- 
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.



_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to