Ive been trying to figure out whats going on when my server eats all
the RAM and crashes as described before but can make a small recall of
when:
When trying to extract data from the database example command rs <-
dbGetQuery(con, "SELECT * from patient;")
When trying to display that data in this case rs (when i load the data
in small pieces with help of an R script Ive written (appendix A)
So now you may think this isent an R-node problem but an Rserve
problem (at least that was what I was thinking) so I build a small
java program that executed the first of these two and nothing bad
happened it worked...
This made me to believe that it has something to do with the R-node <--
> Rserve interaction thats not working at this special case.
Cuz as you proven its not about printing large amount of data its
about my kind of data (mix of numbers and strings and dates and all
kind of strange things)
I'm not sure what I can do to more pin-point whats going on between R-
node and R-serve at the time of these commands.
If you have any idea please tell me cuz this problem seems like a one
of a kind sort of thing and needs to be solved.
//joel
Apendix A
require(RMySQL)
drv =dbDriver("MySQL")
con <- dbConnect(drv, user='HIDDEN', dbname='REMOVED',
host="127.0.0.1", password='REMOVED', client.flag =
CLIENT_MULTI_STATEMENTS)
script <- paste("SELECT * from A", "SELECT * from B", "SELECT * from
C;", sep = ";")
rs <- dbSendQuery(con, script)
db.A<-NULL
db.B<-NULL
db.C<-NULL
whatQ<-0
repeat{
while(!dbHasCompleted(rs)){
if(whatQ==0){
db.A<-rbind(db.A,fetch(rs,n=51))
}
if(whatQ==2){
db.B<-rbind(db.B,fetch(rs,n=51))
}
if(whatQ==1){
db.C<-rbind(db.C,fetch(rs,n=51))
}
}
whatQ=whatQ+1;
if(dbMoreResults(con)){
rs <- dbNextResult(con)
}
else{
break
}
}
dbDisconnect(con)
dbUnloadDriver(drv)
remove(script)
remove(whatQ)
remove(rs)
remove(drv)
remove(con)