数据库异常android.database.sqlite.SQLiteDiskIOException: disk I/O error (code 1802)

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

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值