仅在ICS的三星Nexus的DROP TABLE - I / O错误磁盘:SQLiteDiskIOException:错误code 10 [英] SQLiteDiskIOException: error code 10: disk I/O error - only on ICS on Samsung Nexus for drop table
问题描述
我们都发现了以下错误
android.database.sqlite.SQLiteDiskIOException: error code 10: disk I/O error
at android.database.sqlite.SQLiteStatement.native_execute(Native Method)
at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:92)
at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1926)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1866)
但仅限于在三星Nexus ICS(4.0.1)。
but only on ICS(4.0.1) on Samsung Nexus.
在仿真器和摩托罗拉Xoom(3.2)上,HTC Desire(2.3.3)的code正常工作。我们的code是针对SDK版本8(2.2.x版)。
On emulator and Motorola Xoom (3.2) , HTC Desire (2.3.3) the code works fine. Our code is targeted at version 8 (2.2.x) of SDK.
该execSQL触发如下:
The execSQL is triggered as follows:
db.execSQL("DROP TABLE IF EXISTS " + table.getTableName());
和数据库内部召开不是在SD卡。
and the db is held internally not on the SD card.
有什么建议?
推荐答案
确定解决这一点。问题是,之前DROP TABLE语句有一个Context.deleteDatabase('DBNAME')声明,显然已经删除了数据库,并在报告的I / O错误,则是非常合情合理的。
OK Solved this. Problem was that prior to the drop table statements there was a Context.deleteDatabase('dbName') statement which had obviously removed the db, and the I/O error being reported then makes perfect sense.
看来,皮带和牙套的方法已被用来previously(不必要的)。
It seems that a belt and braces approach had been used previously (unnecessarily).
然而有趣的是,这并不表现为,直到移动到ICS的问题。
However the interesting thing is that this didn't manifest as a problem until the move to ICS.
这篇关于仅在ICS的三星Nexus的DROP TABLE - I / O错误磁盘:SQLiteDiskIOException:错误code 10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!