Hi All,
We have a read-only database (compiled with CEROD) that needs to be
accessed from within the same program using multiple threads.
Currently, we open the database once and all the threads use the
sqlite3_db* to create their own personal prepared queries and run their
queries.
However, looking at this:
http://www.sqlite.org/cvstrac/wiki?p=MultiThreading
It has never been safe to use the same database connection simultaneously in
multiple threads. If you use the sqlite3_prepare() API to create prepared
statements, each prepared statement is considered to be a part of the
database connection from which it was derived. So you cannot run two
prepared statements originating from the same database connection in
different threads at the same time.
Just trying to understand better:
* What does it mean that "you cannot run two..." --> will it cause an
error, or the results are undefined, or something else?
* Does this apply completely even to systems that definitely have only
read queries?
* Should we open the DB separately from each thread?
Thanks for any inputs.
Best Regards,
Mohit.
29/5/2012 | 9:57 AM.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users