我需要检查我的dbSendQuery()
返回的res
是否已经完成。
我的代码如下:
db <- dbConnect(drv=SQLite(),flags=SQLITE_RW,dbname="db.sqlite",synchronous = "off")
dbBegin(db)
res <- dbSendQuery(db,"Update Operation SET Name = 'teste' where Id = 1")
if("my SendQuery is over"){
dbClearResult(res)
dbCommit(db)
dbDisconnect(db)
}
我需要知道何时结束后,才能提交并断开连接。
更新1: 在我的系统中,对于以上示例可能会发生多个用户同时连接的情况。因此,当第一个数据库连接结束时,我需要完成其请求,并提供给其他连接编写查询的可能性。