Sqlite : Modifying locking criteria inside begin
As per sqlite documentation, when we are using deferred transaction using begin - commit
, database is locked since the first write.
And most probably this lock is there till the transaction is commited. So If I did begin
and did the first write, and commit
comes 180 seconds later, my database is locked till this time.Hence, I cannot do write operations till this time from another thread.
Is there any way that I can tell Sqlite to not hold locks till the commit
and acquire locks only when its writing within the transaction? So that I have some chances of concurrent writing from another thread during that transaction. Or is there any solution?
I am using C Sqlite
library in an embedded environment.
Allowing others to write data that you are reading would results in inconsistent data.
To allow a writer and readers at the same time, enable WAL mode.
链接地址: http://www.djcxy.com/p/64258.html下一篇: Sqlite:修改开始内部的锁定标准