Displaying 1 result from an estimated 1 matches for "anotherdatabaseoperation".
2006 Sep 19
1
RODBC Connections closed automatically in background
...connections. It appears that
my connection to the database is closed by R automatically before
I am done with it.
Here is my code:
foo <- function(dsn) {
db <- odbcConnect(dsn)
odbcSetAutoCommit(db, FALSE)
data <- someDatabaseOperation(db)
data2 <- someLongCalculation(data)
anotherDatabaseOperation(db, data2) # This often fails b/c the db is no longer open.
odbcClose(db)
}
I see some output:
Warning: closing unused RODBC handle 9
Warning: [RODBC] Error SQLDisconnect
Warning: [RODBC] Error SQLFreeconnect
Warning: [RODBC] Error in SQLFreeEnv
Error in odbcGetErrMsg(channel) : first...