Skip to content

sqlite: database is locked. #32

Description

@zephyrize

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions