ReOpen and BackupEnabled
- Lenguaje dominante
- Kotlin
- Estrellas
- 4.8k
- Forks
- 593
- Merge medio
- 1 min
- PR fusionados (30 d)
- 1
Descripción
DBFlow Version: 4.2.4
Bug Request:
When database is reopen and using backupEnabled then after while following error happen:
E/Database: close() was never explicitly called on database '{dbpath}/temp-{dbname}.db'
database.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
at net.sqlcipher.database.SQLiteDatabase.(SQLiteDatabase.java:2402)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1148)
at net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1212)
at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:162)
at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:129)
at com.raizlabs.android.dbflow.sqlcipher.SQLCipherOpenHelper$BackupHelper.getDatabase(SQLCipherOpenHelper.java:125)
at com.raizlabs.android.dbflow.structure.database.DatabaseHelperDelegate.movePrepackagedDB(DatabaseHelperDelegate.java:133)
Description:
This problem happen for calling backupHelper.getDatabase(); in DatabaseHelperDelegate. I am not sure why it is called in performRestoreFromBackup() function so I overwrite it without checking if backupHelper exists and calling getDatabase(). With that modification I can simply use (DatabaseDefinition).reopen without problems. Only when db will be corrupted then movePrepackagedDB will be used where inside system check integrity of temp database and then I see this error.
I think something needs to be done around close database to also close temp database (in reopen function).
Kind regards, Krzysztof
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.