
有没有什么方法可以配置或使用我的sqlite数据库,这样当两个线程在同一个表(但不同的行)上运行更新查询时,一个不等待另一个?也就是说,如何在内存数据库中实现行级锁定?
理论上这应该是可能的,因为我的sqlite数据不在文件中(因此文件系统写入不适用).
决定sqlite是否可以锁定行的不是文件系统.这是sqlite的架构.甚至使用预写日志记录,you can only have one writer at a time.
Writers merely append new content to the end of the WAL file. Because
writers do nothing that would interfere with the actions of readers,
writers and readers can run at the same time. However,since there is
only one WAL file,there can only be one writer at a time.
SQLite3 has a kind of table locking now,但不是行锁定.
总结以上是内存溢出为你收集整理的database – 如何在内存中的SQLite数据库上实现行级锁定?全部内容,希望文章能够帮你解决database – 如何在内存中的SQLite数据库上实现行级锁定?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)