Slqite3 The database file is locked
今天写一个关于数据库方面的东西,但是一直是有错误的提示,错误码 5 #define SQLITE_BUSY 5 /* The database file is locked */
在网上找了一些资料,最后解决问题。
原因是
sqlite 的规则是读写分离。读的时候,不能写,写的时候,不能读。我打sqlite把数据库表打开,没有关闭,处于写入状态,当用代码再次对表格操作时,它提示“Slqite3 The database file is locked”,当把表关闭,可以正常操作了。
原则: 读写分离。问题就应该解决了