我刚刚尝试向 SQLite 数据库添加行,其中文本部分包含“/”字符。
这是我进行连接的方式:
private SQLiteDatabase db;
this.db = this.getWritableDatabase();
db.beginTransaction();
..............................
insertion stuffs
..............................
db.setTransactionSuccessful();
db.endTransaction();
在尝试插入新行时,应用程序崩溃并在日志中给出以下错误:
08-24 19:01:09.477 27064-27064/? E/SQLiteLog﹕ (10) POSIX Error : 11 SQLite Error : 3850
08-24 19:01:09.477 27064-27064/? E/SQLiteLog﹕ (5) database is locked
Process: .MyService, PID: 17827
android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5): , while compiling: PRAGMA journal_mode
这是因为斜杠字符还是其他什么原因?在插入那一行之前它运行得很好,或者是我的表已经损坏了?