I am experimenting with RMySQL and accidentally created a connection without a handle.
dbConnect(MySQL(), user = "foo", password = "bar") connLocalDB = dbConnect(MySQL(), user = "foo", password = "bar")
Please note that returning the first call is not tied to anything. Now when I do dbListConnections(MySQL()) , I see two connections:
> dbListConnections(MySQL()) [[1]] <MySQLConnection:0,0> [[2]] <MySQLConnection:0,1>
Then I tried this:
> dbDisconnect(dbListConnections(MySQL())[[1]]) [1] TRUE
but then I got the following:
> dbListConnections(MySQL()) [[1]] Error in .local(dbObj, ...) : internal error in RS_DBI_getConnection: corrupt connection handle
How to safely terminate a connection that is not assigned a handle?
source share