Error while deleting SQLITE base and create again dynamically ANDROID 9

Asked

Viewed 36 times

0

I have an android Java app running for years. After migrating to android 9 (API 28), I’m having problems constantly:

database disk image is malformed (code 11 SQLITE_CORRUPT) and Android SQLiteDiskIOException (code 522 SQLITE_IOERR_SHORT_READ)

The functioning of the system is as follows, the system has a synchronization process that makes the upload database, prepare a new (External), then do the download, erases the current database on the device and puts the new one that did the download, or the seat is constantly overwritten on the device!

This process always worked perfectly, however in android 9 (api 28) as amazing as it seems after a certain time synchronize and is working on the application occurs the above errors.

I identified that the problem is exactly "overwrite" the database on android 9, even paying for such temporary files -shm and Wal, already switched to disableWriteAheadLogging() or PRAGMA journal_mode=DELETE, close the database before, remove the class instance SqliteOpenHelpe, does not help the bank at some sporadic time gets corrupted randomly while doing 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!

Anybody got any ideas on how to get around the problem? Thank you

No answers

Browser other questions tagged

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