我的应用程序的一些实时用户遇到SQLite数据库损坏.当我们从用户收集日志时,我们发现以下详细信息:
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
损坏的数据库是静态数据库(它有预加载的记录,我们没有做任何插入,更新,更改,删除除了从中选择数据.
这个数据库是我的应用程序的资产,我将它安装到设备并获取其对象
this.staticDb = SQLiteDatabase.openDatabase(AppDelegate.getFileDirectory() + "/" + SDCARD_FOLDER_NAME +DB_FOLDER_NAME + "/" + Dbpath, null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
我想 通过使用此类的方法来处理DefaultDatabaseErrorHandler的此异常,onCorruption
但是没有获得任何适当的实现文档.在我的情况下,我可以使用这个课吗?