Corrupted Sqlite on Android 9 Pie (API 28)

Asked

Viewed 52 times

0

I have an Android Java application running for years. After migrating to Android 9 Pie (API 28), I’m having the following problems constantly:

database disk image is malformed (code 11 SQLITE_CORRUPT)

Android Sqlitediskioexception (code 522 SQLITE_IOERR_SHORT_READ)

The functioning of the system is as follows, the system has a synchronization process that uploads the database, prepares a new (External), then downloads, erases the current database on the device and puts the new one that downloaded, or the seat is constantly overwritten on the device!

This process always worked perfectly, but in API 28 after a certain time of synchronizing and working on the application occurs the above errors.

I identified that the problem is exactly "overwrite" the database. Even deleting such temporary files -shm and wal, already switched to disableWriteAheadLogging() or PRAGMA journal_mode=DELETE, close the seat before, remove the class instance SqliteOpenHelper, but nothing helps. At some sporadic time, the bank is corrupted randomly by making a simple rawQuery().

I’ve already moved to class SqliteOpenHelper with and without Singleton. I’ve already used the command SQLiteDatabase.deleteDatabase before changing the file!

Does anyone have any idea how to solve this problem?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.