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 cyclomatic complexity and why is it important?

1 Answers  


Explain in what order a destructors is called.

0 Answers  


What is the biggest disadvantage of “Other Return Types” in Web API?

0 Answers  


For a server control, you need to have same properties like color maxlength, size, and allowed character throughout the application. How do you handle this?

2 Answers   Microsoft,


Can we make activex dll also ti execute in some process as that of client ? How can we do?

0 Answers   DELL, Zerone,






Explain About duration in caching technique

0 Answers   BirlaSoft,


In a page there is dropdown list with the name of the cities like Bangalore,Pune,Chennai,Other and a text box that would enable the user to enter the name of the city if other is selected. How to enable validation on the text box if other is selected

8 Answers   Proteans,


What is the purpose of the following segment? If ( !IsPostBack) { sqldataAdapter1.Fill (dsusers1); DataGrid1.DataBind (); } a) To populate the DataAdapter the first time the web page id displayed. b) To populate the DataSet every time the web page is displayed. c) To populate the DataAdapter every time the web page is displayed. d)To populate the DataSet the first time the web page is displayed.

2 Answers   Syntax Softtech,


Explain what is the procedure to create the environment for asp.net? : asp.net mvc

0 Answers  


I have around 200+ controls in a page. Each of the sets of controls are kept in divs and when header div is clicked, only those div controls pertaining to that header div will be displayed. Rest of the divs are kept invisible. When the page loads, all these 200+ controls are loaded simultaneously, that consumes much of the time. What my requirement is I want to get the div1 controls loaded when the page loads and rest of the div controls should be loaded asynchronously. it should not be loaded with page load, so that time for loading the page can be much minimised. Hope u understood my question and pls help me out with a solution asap....

2 Answers  


Explain server-side scripting?

0 Answers  


What is difference between machine.config and Web.Config?

4 Answers   Accenture, BirlaSoft, Le Logiciel,


Categories