SQLiteCpp icon indicating copy to clipboard operation
SQLiteCpp copied to clipboard

Question about serialized mode

Open elad-dp opened this issue 3 years ago • 2 comments

Hi, In Database.h it says "a Database object shall not be shared by multiple threads". "SQLiteC++ does not support the fully thread-safe “Serialized” mode of SQLite, because of the way it shares the underlying SQLite precompiled statement in a custom shared pointer (See the inner class “Statement::Ptr”)."

I didn't quite understand the limitation reason for not sharing Database object.

My question is: is it safe if I have a single database connection, and multiple threads are calling a function to read from/write to the database? (the function creates prepared statement locally, so every thread has its own prepared statement)

Thanks

elad-dp avatar Nov 02 '22 16:11 elad-dp

I have similar question. Please let us know what's the behaviour. @SRombauts

abhiarora4 avatar Sep 26 '23 11:09 abhiarora4

Same here. What about using a unique pointer instead?

SuperbTUM avatar Oct 30 '23 00:10 SuperbTUM