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
java.lang.IllegalStateException: database /data/user/0/<app>/databases/<app>_encrypted.db already closed #628
Comments
There is not enough information here to determine what the problem is. Are all of the threads you mentioned sharing a single database connection? Or does each thread have it's own separate connection? Have you determined if there are any exceptions being thrown that might be causing one of your application's threads to close the database connection prematurely? |
Im having a hard time creating a test app that reproduces this, but im definitely seeing quite a bit of it in our production app |
Hello @zkrige - I definitely believe the problem is occurring for you. However, screenshots of Crashlytics don't provide any useable information. Can you please answer the questions earlier in this thread? It is possible that it is a bug, but it is much more likely that somehow one of your threads is closing the database handle unexpectedly. I would really recommend checking any logic related to closing database connections. |
We don't have any calls to close db connections. The DB is provided via a singleton that gets instantiated early on in app lifecycle. It is never closed or released. preliminary testing points to something in the query component going awry but I can't seem to pin down the exact scenario causing it. The reference count is at some point decremented once too many and the library then thinks the db is closed |
I'm not using this library anymore - have moved to https://github.com/sqlcipher/sqlcipher-android/ - will monitor and see if it continues |
Closing as logged against the wrong library, discussion moved to referenced ticket. |
Expected Behavior
DB stays open
Actual Behavior
DB is being closed at some point
Steps to Reproduce
....
SQLCipher version (can be identified by executing
PRAGMA cipher_version;
):4.54 community
SQLCipher for Android version:
4.54
Are you able to reproduce this issue within the SQLCipher for Android test suite?
No
The db seems to behave for a while, and then at some point, it gets closed. I have multiple reads and writes happening from different background tasks.
This is an existing app that was using standard android sqlite. I've just done a drop in replacement for the sqlcipher version. If I revert to standard android sqlite, it works fine
The text was updated successfully, but these errors were encountered: