Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about serialized mode #375

Open
elad-dp opened this issue Nov 2, 2022 · 2 comments
Open

Question about serialized mode #375

elad-dp opened this issue Nov 2, 2022 · 2 comments
Assignees
Labels

Comments

@elad-dp
Copy link

elad-dp commented Nov 2, 2022

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

@SRombauts SRombauts self-assigned this Dec 11, 2022
@abhiarora4
Copy link

abhiarora4 commented Sep 26, 2023

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

@SuperbTUM
Copy link

Same here. What about using a unique pointer instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants