what is SQL cache Invalidation?



what is SQL cache Invalidation?..

Answer / jitender.chauhan

SQL cache invalidation enables you to make the cache entry
dependent on the database, so the cache entry will only be
cleared when data in the database is changed.

Polling-based Invalidation
This mechanism uses polling to check if a table has been
updated since the page was cached.

SQL Server 2005 Notification-based Cache Invalidation
This mechanism uses the query change notification mechanism
of Sql Server 2005 to detect changes to the results of
queries. Unlike polling based invalidation for Sql Server
7.0 and 2000, notification based invalidation requires much
less setup.

1. Unlike polling based validation, no <sqlCacheDependency>
needs to be registered in your application's configuration.
Furthermore, no special configuration using the
aspnet_regsql.exe tool is needed.

2. A notification based dependency is configured on the
OutputCache directive using the string CommandNotification.
This value indicates to ASP.NET that a notification based
dependency should be created for the page or datasource
control.

3. System.Data.SqlClient.SqlDependency.Start() method must
be called somewhere in the application before the first SQL
query is executed. This method could be placed in
Application_Start() event in global.asax file.

Whenever a command is issued to Sql Server 2005, ASP.NET
and ADO.NET will automatically create a cache dependency
that listens to change notifications sent from the SQL
Server. As data is changed in Sql Server, these
notifications will cause the cached queries to be
invalidated on the web server. The next time a page or
datasource control associated with the dependency is
requested, the page or datasource control will be executed
again as opposed to serving cached information.

Is This Answer Correct ?    10 Yes 2 No

Post New Answer

More ASP.NET Interview Questions

What is http post and http get?

0 Answers  


What is ViewState ? and how it is managed ?

1 Answers  


Why SessionID changes in every request in asp.net?

0 Answers   HCL,


What Are The Difference Between AutoEventWireup="true" and AutoEventWireup="False"

12 Answers   Phoenix Technologies,


What are ASP.NET Web Forms? How is this technology different than what is available though ASP (1.0-3.0)?

1 Answers   Siebel Systems,






Explain how asp.net different from asp?

0 Answers  


How to Convert a String into Float without using any built- in library of .NET String = "1235.45" needs to converted to a float

2 Answers   CA, Microsoft,


Where are session variables stored?

0 Answers  


What are the different types of Caching techniques in ASP.NET?

0 Answers  


How can you access the properties and controls of master pages from content pages?

0 Answers  


What is the use of mcommand ? mcommand.fill(ds,"orderdetails");

1 Answers   Netsweeper,


Can we change the session timeout in ASP.NET, if yes then how and from where?

7 Answers   L&T,


Categories