I am experimenting with RMySQL, and have accidentally created a connection without a handle.
dbConnect(MySQL(), user = "foo", password = "bar")
connLocalDB = dbConnect(MySQL(), user = "foo", password = "bar")
Note that the return of the first call is not assigned to anything. Now, when I do a dbListConnections(MySQL())
I see two connections:
> dbListConnections(MySQL())
[[1]]
<MySQLConnection:0,0>
[[2]]
<MySQLConnection:0,1>
I then tried this:
> dbDisconnect(dbListConnections(MySQL())[[1]])
[1] TRUE
but, then, I got this:
> 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?
> dbListConnections(MySQL()) # list the open connections Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘dbListConnections’ for signature ‘"MySQLDriver"’
– PitarysdbListConnections()
is no longer implemented because it's not needed. – Emmalynn