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 cannot be closed gracefully after running a transaction #14709

Open
SkylerLipthay opened this issue Oct 21, 2024 · 0 comments
Open
Labels
bug Something isn't working bun:sqlite Something to do with bun:sqlite

Comments

@SkylerLipthay
Copy link

What version of Bun is running?

1.1.31+e448c4cc3

What platform is your computer?

Linux 6.11.1-arch1-1 x86_64 unknown

What steps can reproduce the bug?

import { Database } from "bun:sqlite";
const db = new Database(":memory:");
db.transaction(() => {})();
db.close(true);

What is the expected behavior?

The database connection is closed successfully.

What do you see instead?

Exception: database is locked

Additional information

I believe this is because the prepared statements used in the transaction controller are never finalized. Perhaps these db.prepare calls can simply be switched to db.query calls?

@SkylerLipthay SkylerLipthay added bug Something isn't working needs triage labels Oct 21, 2024
@nektro nektro added bun:sqlite Something to do with bun:sqlite and removed needs triage labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun:sqlite Something to do with bun:sqlite
Projects
None yet
Development

No branches or pull requests

2 participants