一定要加锁操作数据 否则死 SQLIt 返回

求助
1 370
该叫什么 John 发布于2019/7/5
悬赏:5 飞吻

不加锁情况

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

SQLite error (5): database is locked

加锁 顺利写入数据库


lock (lockObj)

{

            

}


热忱回答1

  • John John VIP0
    2019/7/7

    Sqlite 总结一下



    1.当有写操作时,其他读操作会被驳回

    2.当有写操作时,其他写操作会被驳回

    3.当开启事务时,在提交事务之前,其他写操作会被驳回

    4.当开启事务时,在提交事务之前,其他事务请求会被驳回

    5.当有读操作时,其他写操作会被驳回

    6.读操作之间能够并发执行


    0 回复

版块

学习文档

最新会员

发布达人

回贴达人