atomic read from sqlite database while it is being written to

谁说我不能喝 提交于 2019-12-08 13:24:44

问题


Is it possible to read from a sqlite database while it is being written to?

How would one go about accomplishing this?

Thanks!


回答1:


Read this section of the SQLite FAQ's and also this one.

Basically, since the database isn't controlled by a "proper" DBMS (i.e. a server) there a limitations as to what can be done with it. For instance, you have to wait until one transaction is completed before starting another. Fortunately, the SQLite library does some checking to see if the database is being modified by another library-handled connection before it starts doing stuff to the database.



来源:https://stackoverflow.com/questions/3200150/atomic-read-from-sqlite-database-while-it-is-being-written-to

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!