I've implemented the HellowWorldFromR() method as well as several others but after I execute one from SQL Server one time and attempt a second execution, I get this error, presumably because I call Dispose():
Msg 6522, Level 16, State 2, Line 32
A .NET Framework error occurred during execution of user-defined routine or aggregate "OneSidedHypothesis":
System.InvalidOperationException: The single REngine instance has already been disposed of (i.e. shut down). Multiple engine restart is not possible.
System.InvalidOperationException:
at RDotNet.REngine.GetInstance(String dll, Boolean initialize, StartupParameter parameter, ICharacterDevice device)
at ProviderAnalysisCLR.OneSidedHypothesis(SqlDecimal PriorAverage, SqlDecimal Tau, SqlDecimal ProvMean, SqlDecimal ProvStdDev, SqlDecimal N)
How am I supposed to get around this? Clearly, the engine should be disposed and when I run this as a standard function from a Console app it works fine with repeated executions.
Msg 6522, Level 16, State 2, Line 32
A .NET Framework error occurred during execution of user-defined routine or aggregate "OneSidedHypothesis":
System.InvalidOperationException: The single REngine instance has already been disposed of (i.e. shut down). Multiple engine restart is not possible.
System.InvalidOperationException:
at RDotNet.REngine.GetInstance(String dll, Boolean initialize, StartupParameter parameter, ICharacterDevice device)
at ProviderAnalysisCLR.OneSidedHypothesis(SqlDecimal PriorAverage, SqlDecimal Tau, SqlDecimal ProvMean, SqlDecimal ProvStdDev, SqlDecimal N)
How am I supposed to get around this? Clearly, the engine should be disposed and when I run this as a standard function from a Console app it works fine with repeated executions.