Skip to content

DatabaseBusy error on pool creation with a new file #10

@tomasol

Description

@tomasol

Hi, thanks for the library. I am running into an issue during tests, where I am creating a temporary database with a pool:

let pool = PoolBuilder::new()
            .path(path)
            .journal_mode(JournalMode::Wal)
            .open()
            .await?;

Occasionally I get an error:

Rusqlite(SqliteFailure(Error { code: DatabaseBusy, extended_code: 5 }, Some("database is locked")))

The workaround is to create the file before creating the pool:

let client = ClientBuilder::new()
            .path(&path)
            .journal_mode(JournalMode::Wal)
            .open()
            .await?;
        client.close().await?;
let pool = ...

Not sure if this is worth fixing or just mentioning in docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions