[问题] RSQLite: database is locked

楼主: hl4 (Zec)   2014-06-11 11:25:18
[问题类型]:
程式咨询(我想用R 做某件事情,但是我不知道要怎么用R 写出来)
[软件熟悉度]:
请把以下不需要的部份删除
入门(写过其他程式,只是对语法不熟悉)
[问题叙述]:
我让一支程式更新sqlite database,同时,用r来读取资料。
异步执行时都很正常,但是同时执行会导致一些错误。
> z <- dbGetQuery(conn = db, "SELECT * FROM fftLog where ID = (SELECT MAX(ID)
> FROM fftLog where tag = 'R2')")
Error in sqliteFetch(rs, n = -1, ...) :
RSQLite driver: (RS_SQLite_fetch: failed first step: database is locked)
稍微浏览过sqlite lock mode的说明,sqlite可以同时进行一个写入和多个读取。
这个error应该可以避开,不过不知道应该怎么以r实作。
谢谢。
[程式范例]:
张贴能够重现错误的程式码,可以帮助版友更快的帮你解决问题
程式码可贴于以下网站:
http://ideone.com/
http://codepad.org
http://pastie.org/
http://nopaste.info/
http://pastebin.com/
http://paste.plurk.com
http://gist.github.com/
http://nopaste.csie.org/
[关键字]:
选择性,也许未来有用

Links booklink

Contact Us: admin [ a t ] ucptt.com