I used R to create a SQLite database and now I want to read from it (in parallel from multiple cores that have access to the same sqlite DB) multiple times and write to another DB multiple times, ~ 1,000 or more times in parallel. However, when I try doing such operation I get the following error:
sqliteFetch(rs, n = -1, ...) :
RSQLite driver: (RS_SQLite_fetch: failed first step: database is locked)
In my script I am running the following two commands that I think are giving the error (not sure if it comes from the reading or the writing):
dbGetQuery(db1, sql.query)
# later on...
if(dbExistsTable(db2, table.name){
dbWriteTable(db2, table.name, my.df, append = T)
} else {
dbWriteTable(db2, table.name, my.df)
}
Do you know if such operation is possible? If so, anyway to do it and avoid such error? I asked this question before and I was refered to ACID design of Databases, which make me think such operation should be possible but somehow it's not working.
I am also open to suggestions, such as oh you can use MySQL to do that, should work better, etc.
Thanks!