Hello,

From: http://www.sqlite.org/faq.html#q6

"The restriction on moving database connections across threads was relaxed
somewhat in version 3.3.1 <http://www.sqlite.org/releaselog/3_3_1.html>.
With that and subsequent versions, it is safe to move a connection handle
across threads as long as the connection is not holding any fcntl() locks.
You can safely assume that no locks are being held if no transaction is
pending and all statements <http://www.sqlite.org/c3ref/stmt.html> have been
finalized <http://www.sqlite.org/c3ref/finalize.html>."

In an application which spawns worker threads to issue some queries and has
some other standalone threads that run for the lifetime of the application,
what is the best way to manage a single sqlite3* connection?  Any of the
threads could issue queries and begin/commit transactions against the
database.  I'd also like to use prepared statements with this connection as
well so all threads may use them.

Is this feasible?

Thanks and Happy New Year,

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

Reply via email to