We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
DatabaseBusy
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.
The text was updated successfully, but these errors were encountered:
Sorry for the delayed response, but thanks for filing an issue! I'm curious, what connection parameters are you using to connect?
Sorry, something went wrong.
No problem. Here is a more complete example:
async_test!(check_init); async fn check_init() { let file = tempfile::NamedTempFile::new().unwrap(); let path = file.path(); let pool = PoolBuilder::new() .path(path) .journal_mode(JournalMode::Wal) // .num_conns(1) .open() .await .unwrap(); }
Running the test in a loop fails within seconds.
while true; do cargo test --workspace check_init || break; done
Note that the file must not exist before the test. The other workaround is to set num_conns(1).
num_conns(1)
No branches or pull requests
Hi, thanks for the library. I am running into an issue during tests, where I am creating a temporary database with a pool:
Occasionally I get an error:
The workaround is to create the file before creating the pool:
Not sure if this is worth fixing or just mentioning in docs.
The text was updated successfully, but these errors were encountered: