Some of the live users of my application experience SQLite database corruption . When we collected the magazine from users, we found the details below:
E/SQLiteLog(14085): (11) database corruption at line 57189 of [b3bb660af9] E/SQLiteLog(14085): (11) Invalid page count: nPage: 52, nPageFile: 50 E/SQLiteLog(14085): (11) lockBtree() error, rc: 11, printing out first page (size: 32768) of DB /data/data/com.app.testpackagename/files//db/statictext_v3.0_DE.db E/SQLiteLog(14085): (11) Page (1) has been corrupted E/SQLiteLog(13318): (11) database disk image is malformed E/DefaultDatabaseErrorHandler(13318): Corruption reported by sqlite on database: /data/data/com.app.testpackagename/files//db/statictext_v3.0_DE.db E/SQLiteLog(13318): (11) database corruption at line 57189 of [b3bb660af9] E/SQLiteLog(13318): (11) Invalid page count: nPage: 52, nPageFile: 50 E/SQLiteLog(13318): (11) lockBtree() error, rc: 11, printing out first page (size: 32768) of DB /data/data/com.app.testpackagename/files//db/statictext_v3.0_DE.db E/SQLiteLog(13318): (11) Page (1) has been corrupted
A corrupt database is a Static database (it preloads records, and we do not do any Insert , Update , Change , Delete , except Select data from it.
This database is in the assets of my application, and I install it on the device and get its object using
this.staticDb = SQLiteDatabase.openDatabase(AppDelegate.getFileDirectory() + "/" + SDCARD_FOLDER_NAME +DB_FOLDER_NAME + "/" + Dbpath, null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
I want to handle this exception with the DefaultDatabaseErrorHandler using the onCorruption
method of this class, but without getting the proper documentation for the implementation, Can I use this class in my case?
source share