Re: [Cppcms-users] Threaded access to SQLite
Brought to you by:
artyom-beilis
From: Josh H. <jo...@ni...> - 2017-01-09 17:36:11
|
On Sun, Jan 8, 2017 at 12:17 AM, Artyom Beilis wrote: > In general sqlite3 behaves poorly with multiple threads and you should > make yourself ready to deal with the issue - simultanious updates and > even query + update may fail. > > Artyom Currently the cppdb_sqlite3 driver attempts to open a new connection to the database via sqlite3_open_v2() for each thread. >From the SQLite documentation, it would seem that a given process should only have one shared connection to the database. If that is the case, then the cppdb_sqlite3 driver is written contrary to the intended usage of sqlite3. It seems that the right thing to do may be to open a single connection and share it between the threads. |