的SqlDependency VS的SqlCacheDependency [英] SqlDependency vs SqlCacheDependency

查看:188
本文介绍了的SqlDependency VS的SqlCacheDependency的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些是什么,当他们要使用的主要区别?我最初的理解是的SqlCacheDependency使用查询,但我读过它没有太多的ASP.NET 2.0。我想知道这是最适合下的ASP.NET Web服务器LINQ查询缓存。这将是ASP.NET 3.5。


  

本的SqlCacheDependency类还
  支持与整合
  System.Data.SqlClient.SqlDependency
  类使用SQL Server 2005时,
  数据库。查询通知
  SQL Server 2005的检测机制
  更改数据无效
  SQL查询并消除了结果
  与相关的任何缓存条目
  从SQL查询
  的System.Web.Caching.Cache。



解决方案

查询通知是底层技术。 SqlNotificationRequest是ADO.Net客户端支持。
的SqlDependency是ADO.Net基础设施自动化由SqlNotificationRequest需要临时对象的部署。的SqlCacheDependency使用的SqlDependency它与ASP缓存基础设施集成。更多信息请访问神秘的通知

请注意他们使用LINQ工作。请参见 LinqToCache 了解,利用查询通知与LINQ查询,并且也是为什么绝大多数LINQ的解释项目查询不能使用查询通知。

What are the key differences between these and when should they be used? My initial understanding was that SqlCacheDependency used polling but I've read it doesn't have too for ASP.NET 2.0. I want to know which is most appropriate for caching of linq queries under ASP.NET web server. This will be ASP.NET 3.5.

The SqlCacheDependency class also supports integration with the System.Data.SqlClient.SqlDependency class when using a SQL Server 2005 database. The query notification mechanism of SQL Server 2005 detects changes to data that invalidate the results of an SQL query and removes any cached items associated with the SQL query from the System.Web.Caching.Cache.

解决方案

Query Notification is the underlying technology. SqlNotificationRequest is the ADO.Net client support. SqlDependency is the ADO.Net infrastructure to automate the deployment of temporary objects needed by SqlNotificationRequest. SqlCacheDependency uses SqlDependency to integrate it with the ASP caching infrastructure. See more at The Mysterious Notification.

Note on them work with LINQ. See LinqToCache for a project that leverages Query Notifications with LINQ queries, and also explains why the vast majority of LINQ queries cannot use Query Notifications.

这篇关于的SqlDependency VS的SqlCacheDependency的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆