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

Document :memory: database connection issues, perhaps enforce a single connection. #309

Closed
AlexMax opened this issue Jun 8, 2016 · 2 comments

Comments

@AlexMax
Copy link

AlexMax commented Jun 8, 2016

I encountered a strange bug with an in-memory database where I was accidentally leaving transactions uncommitted. To my surprise, it turns out that every new connection creates a brand-spanking new in-memory database, which meant that I wasn't running queries against the database I thought I was, but a blank database, resulting in some perplexing errors involving missing data that I was sure was actually there.

I eventually fixed the bug by eliminating an extraneous Begin() that had crept into my code, but I can't imagine a situation where "please run this query against a fresh database" would be desirable. Could this behavior at the very least be documented somewhere? It'd be nice if perhaps the driver could somehow limit the number of concurrent connections to in-memory databases to one, but you might still need to document this behavior so people don't get confused when they run into a deadlock caused by connection that was left open.

@dgsb
Copy link
Contributor

dgsb commented Sep 16, 2016

Hello @AlexMax, did you observed any behaviour different from the ones described here: https://www.sqlite.org/inmemorydb.html ?

@fgrosse
Copy link

fgrosse commented Nov 15, 2016

This seems to be a duplicate of #204 or at the very least it is related.

tych0 added a commit to tych0/go-sqlite3 that referenced this issue Jan 26, 2017
Closes mattn#204
Closes mattn#309

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants