遇到的一些SQLite异常
android.database.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 layer 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文件里边用了多个表格,不同的表,不同的表也不能同时操作。