Questions tagged [sqlcachedependency]

Establishes a relationship between an item stored in an ASP.NET application's Cache object and either a specific SQL Server database table or the results of a SQL Server 2005 query

System.Object
. System.Web.Caching.CacheDependency
. . System.Web.Caching.SqlCacheDependency

Namespace: System.Web.Caching
Assembly: System.Web (in System.Web.dll)

On all supported versions of SQL Server (Microsoft SQL Server 7.0, Microsoft SQL Server 2000, and SQL Server 2005) the SqlCacheDependency class monitors a specific SQL Server database table. When the table changes, items associated with the table are removed from the Cache, and a new version of the item is added to the Cache.

http://msdn.microsoft.com/en-us/library/system.web.caching.sqlcachedependency.aspx

78 questions
0
votes
1 answer

Sql Server not creating subscription for simple select query using SqlCacheDependency

I was trying to implement a simple SQLCacheDependency to cache objects in my asp.net application. After breaking my head for quite a while, I seem to have hit a dead end and thought an outside view would be help. SqlCommand cmd = new…
shashi
  • 4,616
  • 9
  • 50
  • 77
0
votes
1 answer

Do I need to specify the same query for SqlCacheDependency which I used to query the db?

Lets say I use a query as below to get a large result set. Select UserID,FirstName, LastName, City, Age from UserInfo where DateDiff(d,GetDate,LastActiveOn) > 180 Now, I want to cache each object returned by the query and invalidate the object…
shashi
  • 4,616
  • 9
  • 50
  • 77
0
votes
1 answer

SqlCacheDependency does not seem to have OnChange event?

I am trying to Cache a few data objects, which are used very frequently and thus are queried very often loading the db server. However these do not change that frequently, making them good candidates for caching. However, whenever they are changed…
shashi
  • 4,616
  • 9
  • 50
  • 77
0
votes
2 answers

Find underlying tables of views using Linq to Entity to make Aggregate Dependencies

I have a function: public static List EntityCache(this System.Linq.IQueryable q, ObjectContext dc, string CacheId) { try { List objCache = (List)System.Web.HttpRuntime.Cache.Get(CacheId); …
Moons
  • 3,833
  • 4
  • 49
  • 82
0
votes
1 answer

Effect on SqlCacheDependency and Broker Service when database schema change

I am creating an application with Sql cached dependency. For this i enabled the broker by Alter database test ENABLE_BROKER After i add two new tables to the database. But i found that i am not able to get any notification services for the new…
Moons
  • 3,833
  • 4
  • 49
  • 82
0
votes
1 answer

High CPU Usage on SQL Server Caused by SqlCacheDependency

We are experiencing an issue where our sql server where cpu usage jumps to and remains at 100% until the site is taken down and restarted. We have gone through the code and optimized everything we can, and this is still happening. What we do with…
0
votes
1 answer

Can I reset the ChangeId in Cache Table for Change Notification

What happens if I reset the changeId value in the table AspNet_SqlCacheTablesForChangeNotification One of the rows is currently maxed out at 2.x billion, and our updates are failing. I tried changing the type to BigInt but the application reading…
DaveDev
  • 41,155
  • 72
  • 223
  • 385
0
votes
1 answer

SqlCacheDependency & custom table change

We are using a third party who's own implementation of caching has very poor performance rates when we measure making requests via their API and their database. Their database (Sql Sever 2005 - running in compatiablity mode - so thinking it is…
Zal
  • 43
  • 3
0
votes
3 answers

SQL Column name for indicating a change

I didn't really know how to formulate the title. But this is my problem. We are using SqlCacheDependencies to update out cache objects. But the query behind this is "complicated" that we would like to make it somewhat easier. Our first thought was…
user29964
  • 15,740
  • 21
  • 56
  • 63
0
votes
2 answers

Memory cache with sql cache dependency

I'm trying to cache data like application resources which already stored in database. How do I implement memory cache with SQL cache dependency in .NET Core?
0
votes
1 answer

SP cache plan not generated

There is something weird in this statement COALESCE(@param_ids + ',', '') @param_ids are passed in as param and it is @param_ids VARCHAR(MAX) Any idea why the SQL-Server could not able to produce a cache plan for below scenario. This issue has been…
0
votes
0 answers

"Current user *** have no permission.",it showed this while using SqlCacheDependency and HttpRuntime.Cache.How to solve it?

SqlCacheDependencyAdmin.EnableNotifications(connString); SqlCacheDependencyAdmin.EnableTableForNotifications(connString, tableName); SqlCacheDependency sqlDenpendency = new SqlCacheDependency(entryName,…
0
votes
2 answers

How to remove the "user specific data-cache" once the session(In Proc) gets timeout in ASP.Net?

We are setting session-timeout for 1 hour: It works as expected. Alongwith "Session", we create user specific data-cache to reuse the data. We use unique cache-key for…
Pranav Kumar
  • 249
  • 1
  • 5
  • 16
0
votes
2 answers

Unable to invalidate the cache dependent on sql query

I am trying to invalidate the cache based on the change in the rows of the database. I have achieved success while doing the same thing with linq with the same database and table but Iam not able to do it in the basic way: Here is the code that I…
Rishabh Ohri
  • 1,280
  • 4
  • 16
  • 28
0
votes
1 answer

PHP version of ASP.NET's SqlCacheDependency

I find the SqlCacheDependency very useful when writing C# ASP.NET applications, and would love to use something similar in my PHP applications. Can anyone suggest something? SqlCacheDependency caches the page page output forever, until the specified…
Greg
  • 21,235
  • 17
  • 84
  • 107