Hi All,
Are there any implications of using SqlDependency and LINQ to SQL together. Or do we have to take care of some things specially to make them work properly?
In our application we are using LINQ to SQL as an ORM and business logic is in the Stored Procedures. We cache the output of the SPs and create SQLDependency. Whenever the output of the SPs change the cache gets invalidated.
Our code so far was working fine in Dev, Test and QA but recently it stopped working in QA and logs suggest that the error is coming from SqlDependency.Start(ConnStr) which is executed in the global.asax file in Application Start block.
The error is as follows: 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.
But I do not understand that when the SqlDependency.Start() is already executed in Application Start why does it throws exception afterwards when the SPs are executed.
Can anyone throw some light on this problem?