开发者

Resolving conflict with RSQLite and RMySQL in the same session

开发者 https://www.devze.com 2023-03-04 18:36 出处:网络
I don\'t know that this is an RSQLite/RMySQL conflict, but that\'s my best guess so far. I use RMySQL to get data from a MySQL database, then I close that connection with dbDisconnect(). Then I use t

I don't know that this is an RSQLite/RMySQL conflict, but that's my best guess so far.

I use RMySQL to get data from a MySQL database, then I close that connection with dbDisconnect(). Then I use these data to in a record linking process using the RLBigDataLinkage() function in the RecordLinkage package开发者_运维百科. This function uses an SQLite database and the RSQLite package because there are two many possible matches to keep all of them in memory. As far as I can tell from the documentation, there is no way to explicitly close the SQLite connection.

Then I use these matches to pull a larger dataset from my MySQL database, again with RMySQL. I can connect to the database, but when I query, I get the following error:

Error in mysqlExecStatement(conn, statement, ...) : 
  RS-DBI driver: (could not run statement: MySQL server has gone away)

This happens even with trivial queries.

> dbGetQuery(db, "SELECT * FROM ann_id_info LIMIT 5")
Error in mysqlExecStatement(conn, statement, ...) : 
  RS-DBI driver: (could not run statement: MySQL server has gone away)

I can still query from the MySQL command line, though.

Is there a way I can disconnect an "unknown" RSQLite connection? Thanks!

0

精彩评论

暂无评论...
验证码 换一张
取 消