'Error: Invalid object argument in a call to 'R_MakeExternalPtr()''

Working with Spotfire 7.0.1 on a Windows 7 64bit machine - 32bit office installed. 

I have an R script that runs when a button is pressed - it uses the RODBC package and updates a table inside of an SQL server using a system DSN.

I can open a TERR console and run the script over and over again manually.  But running it within spotfire does not work more than once.

Thanks very much for any help you can provide.

It runs successfully the first time after a clean start up of Spotfire, then it returns the following error:

Could not execute function call.
TIBCO Enterprise Runtime for R returned an error: 'Error: Invalid object argument in a call to 'R_MakeExternalPtr()''.
   at Spotfire.Dxp.Data.DataFunctions.Executors.LocalFunctionClient.OnExecuting(FunctionClient funcClient)
   at Spotfire.Dxp.Data.DataFunctions.Executors.AbstractFunctionClient.d__0.MoveNext()
   at Spotfire.Dxp.Data.DataFunctions.Executors.SPlusFunctionExecutor.d__0.MoveNext()
   at Spotfire.Dxp.Data.DataFunctions.DataFunctionExecutorService.d__6.MoveNext()

Here is my R script code --- b, di, API10, qi, and days all come from document properties set by the user:


b <- as.numeric(documentpropb)
di <- as.numeric(documentpropdi)
API10 <- selectedAPI10
qi <- as.numeric(documentpropqi)
wellboreb <- as.numeric(b)
wellboredi <- as.numeric(di)
wellboreqi <- as.numeric(qi)
days <- daystostart
con1 <- NULL
odbcCloseAll()

## database connection

# this is SQL server
con1 <- odbcConnect("Vertical", uid="", pw="")

# create dataframe that will be used to update the "wellbore" table in dbs
wellbore_df <- data.frame(API10, b, di, qi, wellboreb, wellboredi, wellboreqi, days)
sqlUpdate(con1, wellbore_df, tablename = "Wellbore_Dc_Parms", index = "API10")

## close the connection
con1 <- NULL
odbcCloseAll()

 

1 Comment

Having the exact same problem, ever find a solution for this?

Thanks. 

andrew.pruet - Jul 19, 2016 - 10:55pm ::
+ Add a Comment

(1) Answer

Login