Skip to content

sqlite: database is locked. #32

@zephyrize

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.

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