3

I'm currently using Microsoft SQL Server 2008.

My production server has a very heavy load.

My C# application uses 'SqlDependency' class in order to monitor some table changes.

On development environment - the application works fine, and the change events from the SQL server gets fired correctly.

On production environment - the application gets change events even when there wasn't any change. I have read that the 'SqlDependency' doesn't perform well on heavy load.

I'm looking for other solution to this scenario, any suggestions ?

4

1 回答 1

2

如果您在没有更改时收到通知,则意味着其他事情触发了通知。您必须始终检查处理程序SqlNotificationEventArgs收到的参数,并OnChange根据 , 和 做出适当 InfoSource反应Type。在生产中,您很可能会收到通知,例如Info.Options表示不正确的 SET 选项(即特定于环境的问题)。

至于关于SqlDependency负载不足的评论,您必须链接源。但是查询通知总体上是针对很少更改的数据的缓存失效而设计的。

于 2013-06-25T10:21:11.983 回答