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

sqlite: database is locked. #32

Open
zephyrize opened this issue Mar 21, 2024 · 0 comments
Open

sqlite: database is locked. #32

zephyrize opened this issue Mar 21, 2024 · 0 comments

Comments

@zephyrize
Copy link

First of all, thank you for your work, which has brought convenience to my work.

Recently in my engineering practice, I have a question about database interaction. Suppose I create a database connection pool db_client (by OATPP_COMPONENT(std::shared_ptr, m_database);), can db_client be injected into multiple services (such as: user_service, login_service, home_service ...)? And can it read and write database files concurrently and safely? Is it necessary to manually add a read-write lock when executing the statement:db_client->?

I recently discovered in the code that if one service is writing and another service is reading, it will trigger the "database to be locked", which make me confused.

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

No branches or pull requests

1 participant