遇到的一些SQLite异常
android.data .sqlite.SQLiteDiskIOException: disk I/O error (code 1802)
原因:The SQLITE_IOERR_FSTAT error code is an extended error code for SQLITE_IOERR indicating an I/O error in the VFS while trying to invoke fstat() (or the equivalent) on a file in order to determine information such as the file size or access permissions.
具体来说,比如存储空间不足、文件读写权限不够,或者多线程操作(SQLite不支持多线程同时操作,自己枷锁)。
SQLiteDiskIOException: disk I/O error (code 3850):
The SQLITE_IOERR_LOCK error code is an extended error code for SQLITE_IOERR indicating an I/O error in the advisory file locking logic. Usually an SQLITE_IOERR_LOCK error indicates a problem obtaining a PENDING lock. However it can also indicate miscellaneous locking errors on some of the specialized VFSes used on Macs.
报此异常,一般就是多线程操作数据库时逻辑上的问题导致了锁异常。
这种情况就要注意了,即便是一个db文件里边用了多个表格,不同的表,不同的表也不能同时操作。
继续阅读与本文标签相同的文章
-
美国SpaceX公司计划向太空发射4.2万枚通信卫星
2026-05-18栏目: 教程
-
这几个小程序,让你的生活质量提高30%
2026-05-18栏目: 教程
-
超赞的二次识图精要讲解
2026-05-18栏目: 教程
-
为何如今很少看到电脑病毒?专家道出3点原因,现在知道不算晚
2026-05-18栏目: 教程
-
雷诺与Waymo将合作开发自动驾驶路线
2026-05-18栏目: 教程
