使用SqlDependency和LINQ to SQL有什么影响吗?或者我们需要特别注意一些事情来使它们正常工作吗?
在我们的应用程序中,我们使用LINQ to SQL作为ORM,业务逻辑在存储过程中。我们缓存SPs的输出并创建SQLDependency。每当SPs的输出更改时,缓存就会失效。
到目前为止,我们的代码在Dev、Test和QA中都运行良好,但最近在QA中停止工作,日志表明错误来自于在Application Start块中执行的SqlDependency.Start(ConnStr)。
错误如下: Message : When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance.
但我不明白,既然SqlDependency.Start()已经在Application Start中执行了,为什么在执行SPs之后会抛出异常。
有人能解决这个问题吗?
在我们的应用程序中,我们使用LINQ to SQL作为ORM,业务逻辑在存储过程中。我们缓存SPs的输出并创建SQLDependency。每当SPs的输出更改时,缓存就会失效。
到目前为止,我们的代码在Dev、Test和QA中都运行良好,但最近在QA中停止工作,日志表明错误来自于在Application Start块中执行的SqlDependency.Start(ConnStr)。
错误如下: Message : When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance.
但我不明白,既然SqlDependency.Start()已经在Application Start中执行了,为什么在执行SPs之后会抛出异常。
有人能解决这个问题吗?