-
Notifications
You must be signed in to change notification settings - Fork 568
net.sqlcipher.database.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here #262
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
Comments
Not seeing your code, I can only make assumptions. I found it best to extend SQLiteOpenHelper and only bother closing cursors when I'm done with them. Due to device rotation recycling the app, I gave up on managing the DB file closure myself and decided to let the OS and SQLiteOpenHelper class deal with that. Here's a good resource to look over Local Databases with SQLiteOpenHelper. |
Hi @SyllaJay In conjunction with @theBlbDan's response, it is quite difficult to determine the cause of the error with the information provided. Also, it appears you are utilizing a third-party database library on top of SQLCipher for Android. Are you able to recreate an the behavior with the SQLCipher for Android test suite? Additional information with an isolated scenario would be beneficial in debugging this situation. Thanks! |
Thanks for response. Code snippet: public void batchInsertOrUpdateSession(List entityList) { |
Thank you @developernotes . I'm working on it. |
I got “net.sqlcipher.database.DatabaseObjectNotClosedException” frequently. My app use "greendao-encryption:2.2.2" and "sqlcipher:3.5.4".
I saw #176 . Anyone can help please?
Releasing statement in a finalizer. Please ensure that you explicitly call close() on your cursor: INSERT OR REPLACE INTO "Session" ("_id","SESSION_KEY","TALK_ID","CREATED","UPDATED","COLOR","LAST_VI
net.sqlcipher.database.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
at net.sqlcipher.database.SQLiteCompiledSql.(SQLiteCompiledSql.java:62)
at net.sqlcipher.database.SQLiteProgram.(SQLiteProgram.java:103)
at net.sqlcipher.database.SQLiteStatement.(SQLiteStatement.java:39)
at net.sqlcipher.database.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1556)
at de.greenrobot.dao.database.EncryptedDatabase.compileStatement(EncryptedDatabase.java:66)
at de.greenrobot.dao.internal.TableStatements.getInsertOrReplaceStatement(TableStatements.java:67)
at de.greenrobot.dao.AbstractDao.insertOrReplace(AbstractDao.java:335)
..... Our code just call insertOrReplace ......
The text was updated successfully, but these errors were encountered: