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

How to proper close database? after colse statement still exists #59

Open
HannesRammer opened this issue Oct 7, 2016 · 2 comments
Open

Comments

@HannesRammer
Copy link

HannesRammer commented Oct 7, 2016

im on
ubuntu 16.04
dart sdk 1.19
sqlite 0.4.0

  1. I do
    ...
    var db = new sqlite.Database("pathtosqlite")
    ...
  2. I get a database connection and pass it through some functions
    ...
    var x = await doStuff(db); (doing several db.query() calls)
    db.close()
    ...

but then I always get an error saying

...
Warning: sqlite.Database.close(): 2 statements still open.
finished with exit code 139 (interrupted by signal 11: SIGSEGV)
...

any tips on what Im doing wrong?

@mezoni
Copy link

mezoni commented Oct 8, 2016

You (and, of course, mostly an authors of this software) should learn how works the sqlite and how to properly use sqlite.
Your problem not in your code, the problem which you are experiencing only in that the authors of this software does not provided the correct way to use sqlite.
If they are professionals then I think they will be able to find the problem in a few minutes.

@pylaligand
Copy link
Owner

Thanks @mezoni for the stellar comment, this is super helpful.

@HannesRammer could you give more insight into what doStuff does? IIRC there will be issues if you get a stream of rows and do not reach the end of the stream (which takes care of disposing the underlying resources). You might need to get a StreamSubscription and cancel when you're done with it.

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