So, I've just starting messing around with the development version of RMySQL -- v.0.11.0.9000 -- and I've noticed that when trying to check if I had any open connections -- using DBI v. 0.3.1.9008 -- I get the error:
> DBI::dbListConnections(MySQL())
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘dbListConnections’ for signature ‘"MySQLDriver"’
Indicating that RMySQL no longer extends dbListConnections for its driver (pardon my adhoc jargon)... Am I right in interpreting this as we no longer need to clean up our DB connections?
If not, how are we supposed to clean up after ourselves?
You don't have to cleanup after yourself, but it's still recommended. Just dbDisconnect(con) when you're done with it. If you don't happen to have con in an easily accessible format, don't worry about it.
Related
When I load the vega-lite data sets using
(vega:load-vega-examples)
I get the following error:
Could not REQUIRE CL-DATE-TIME-PARSER: circularity detected. Please check your configuration
However, the examples appear to have loaded.
Also, before I installed cl-date-time-parser in quicklisp, I was getting an error message similar to:
Do not know how to REQUIRE CL-DATE-TIME-PARSER
Does anyone know how to get rid of these errors?
Many thanks!
The IMDB example requires cl-date-time-parser. I suspect that problem is that (require ...) only works when the library is in a location known to ASDF. In a new installation, this may not be the case. Now reported as issue #19.
Try loading the library with quicklisp and then rerunning load-vega-examples.
R is unable to read the EXASOL Database due to some unknown ODBC error. Has anyone come across a similar instance. The problem occurs with Mac OS.
I have installed the ODBC driver for Mac OS.
library(exasol)
library(RODBC)
con <- dbConnect("exasol", **)
# removed the connection credentials
df1 <- dbGetQuery(con,paste("query", sep=""))
# removed the query
Error in try(.Call(C_asyncRODBCQueryFinish, slot, 1)) :
Unknown ODBC error
Error in exa.readData(conn, statement, ...) :
Could not allocate SQLAllocHandle (-2)
Error in exa.readData(conn, statement, ...) : Unknown ODBC error
The issue is at the moment unanswered here https://github.com/exasol/r-exasol/issues/32.
Can you tell more about the tools/drivers/components you use? Version numbers and the like?
I have some faint memories of seeing the same (or very similar error message) when I tried to use unixodbc. I had to remove it and use libiodbc. May it be the source of the issue in your case?
I had a similar issue, what helped me was to reinstall install.packages("RODBC", type="source")
Connecting Excel with 'ABC' throught Excel works, connecting R with Excel by DDE works also, but how to connect R with 'ABC' application ?
I have application providing DDE interface, from Excel I could retrieve value from it with this DDE reference :
='ABC'|DDE!_nazwa_value
from R I've tried to use tcltk2 library, as follows :
tcltk2::tk2dde.request(service="ABC", topic="DDE", item="_nazwa_value")
but error occurs :
Error in structure(.External(.C_dotTcl, ...), class = "tclObj") :
[tcl] remote server cannot handle this command.
[1] "Error in structure(.External(.C_dotTcl, ...), class = \"tclObj\") : \n [tcl] remote server cannot handle this command.\n\n"
attr(,"class")
[1] "try-error"
attr(,"condition")
<simpleError in structure(.External(.C_dotTcl, ...), class = "tclObj"): [tcl] remote server cannot handle this command.
I'm only trying to use tcltk dde functions to retrieve data from application, I think that item part of my tk2dde.request is wrong, but I've tried various modification (without _ for example), do you know any clues or resources for solving this problem ?
EDIT
something is wrong I don't see ABC server nor DDE topic on server-topic list :
tk2dde.services() but Excel can still connect and retrieve value using ='ABC'|DDE!_nazwa_value, DDE Query also do not see it
You can read in the article about DDE in tcl/tk wiki:
(Talking about using Internet Explorer) ... All of the above experiments should "work" reliably, in that, from the user perspective, IE indeed acts as described. However, back in the Tcl process, [dde] typically throws a "remote server cannot handle this command" exception. That's because, in KBK's analysis, DDE gives no "way to distinguish 'result expected, but the server failed to provide it' from 'no result is expected'." The only way not to receive a DMLERR_NOTPROCESSED is to invoke "dde exec -async ..."
Note: i tried tcl examples of DDE using Excel + "request" and i got the same error as you: "remote server cannot handle this command".
Saludos!,
I am a starter in R and new to StackOverflow and this is the first time I raise a question, I hope i'm following all the rules...
Anyway. I got R (3.5.0 version) and R-Studio on my laptop with Win 10 Home installed (under the same parent folder 'D:\') and reset the temporary file directory to a folder in D:\ so that the Chinese in C:\Users\中文\documents (which is the default place for tempo files) doesn't affect the connection btw R-studio and R (I was told any relevant directory has to be in English to make R-Studio work).
The problem is, I cannot install the 'graphics' package when I run
install.packages('graphics')
The resulting error says something like this:
>Error in install.packages : Updating loaded packages
>Restarting R session...
>Error in gzfile(file, "wb") : cannot open the connection
>Error saving session (options): R code execution error
>WARNING: Forcing suspend of process in spite of all session data not being fully saved.
It's quite weird since the 'graphics' package is pretty basic and as a matter of fact I haven't found anyone reporting such errors on the internet.
It also bothers me that other packages like 'forecast' and 'XML' can be successfully installed without any error report.
I've looked at some similar questions on StackOverflow, having error reports with "Error in gzfile(file, "wb") : cannot open the connection", but they all seem to have something else to complete the sentence. In my case it just stops the error description with "cannot open the connection". Also I couldn't find people having similar problems with "Error saving session (options): R code execution error".
I do realize that this is quite unusual. I can't even find the proper tags other than r for this question. Although it seems that no one has trouble with the 'graphics', this problem is really bothering me and I hope someone can give possible solutions. Thanks a lot.
Just updated to R 3.0 and updated all the packages, including DBI. To my surprise, a script that I often use stopped working.
I am unable to connect to a MySQL database using dbConnect. The code script instantly, so only a few lines will reproduce the problem
> require("RMySQL")
> m = dbDriver("MySQL")
> dbConnect(m, user = 'user', password = 'pass', dbname = 'dbname', host = 'localhost', client.flag = CLIENT_MULTI_STATEMENTS)
Error in as.integer(from) :
cannot coerce type 'S4' to vector of type 'integer'
Calls: dbConnect ... mysqlNewConnection -> isIdCurrent -> as -> asMethod
Also tried it as:
dbConnect(MySQL(), user = 'user', password = 'pass', dbname = 'dbname', host = 'localhost', client.flag = CLIENT_MULTI_STATEMENTS)
but the same problem
Also tried removing other parameters, but the same issue from the dbDriver.
What changed in the DBI package with the latest update? How can I fix this?
I noticed that the DBI package is orphaned so don't know who to ask.
I had the same issue with R 3.0.1 on ubuntu.
Installing the latest version of the RMySQL-package resolved the problem:
> install.pacakges("RMySQL")
Make sure to restart R after the installation.
I'm still digging into the issue, but I think I've identified multiple causes of this issue. At their root, they all have to do with R expecting an S4 object but getting back an integer instead. I believe these are generally a result of the connection failing to establish.
Why is it failing? One thing I've noticed is that if you fail to close to many of your connections (~16 [see the number of maximum connections specified in the driver handle call] open) DBI won't/can't open a new connection. Make sure you are calling dbDisconnect as needed. Usually, this sort of problem results in a sensible error message, however sometimes results in the above referenced error. If possible access the DB through an abstraction layer, e.g. dplyr as some will monitor the db connections and kill them if they are inactive. Whereas, AFIK if you open a connection in a function and the function breaks, you have no way to close the open connection unless you returned the driver object from your initial call to dbConnect. In this case you have no choice but to restart your instance of R (possibly resetting your machine and clearing your workspace as well).
The other issue I recently encountered is that if RMySQL masks RPostgreSQL, then RPostgreSQL will fail. The reverse does not appear to be the case, but because others have mentioned RPostgreSQL in here as showing the same error message, it seemed worthy of note.
Update
The latest version of RMySQL (0.10.1) seems to have finished off RPostgreSQL - RPostgreSQL now fails to work regardless of load order. The same people working on RMySQL appear to be working on RPostgres (https://github.com/rstats-db/RPostgres) and this conflict appears to be a non-issue if using that package instead of RPostgreSQL. Specifically, use RPostgres::Postgres() in the place of RPostgreSQL::PostgreSQL() when specifying the driver in dbConnect. Other packages, e.g. dplyr, currently assume RPostgreSQL, so this issue can still bite (but it seems a resolution is in the works (https://github.com/rstats-db/RMySQL/issues/28).