Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How do we enable SQL Cache Dependency in ASP.NET 2.0
How do we enable SQL Cache Dependency in ASP.NET 2.0?
✍: Guest
Below are the broader steps to enable a SQL Cache Dependency:-
• Enable notifications for the database.
• Enable notifications for individual tables.
• Enable ASP.NET polling using “web.config” file
• Finally use the Cache dependency object in your ASP.NET code
Enable notifications for the database.
Before you can use SQL Server cache invalidation, you need to enable notifications for
the database. This task is performed with the aspnet_regsql.exe command-line utility,
which is located in the c:\[WinDir]\Microsoft.NET\Framework\[Version] directory.
aspnet_regsql -ed -E -d Northwind
-ed :- command-line switch
-E: - Use trusted connection
-S: - Specify server name it other than the current computer you are working on
-d: - Database Name
So now let’s try to understand what happens in the database because of
“aspnet_regsql.exe”. After we execute the “aspnet_regsql -ed -E -d Northwind” command
you will see one new table and four new stored procedures created.
Essentially, when a change takes place, a record is written in this table. The SQL Server
polling queries this table for changes.
Just to make brief run of what the stored procedures do.
“AspNet_SqlCacheRegisterTableStoredProcedure” :- This stored procedure sets a table
to support notifications. This process works by adding a notification trigger to the table,
which will fire when any row is inserted, deleted, or updated.
“AspNet_SqlCacheUnRegisterTableStoredProcedure”:- This stored procedure takes a
registered table and removes the notification trigger so that notifications won't be generated.
“AspNet_SqlCacheUpdateChangeIdStoredProcedure”:- The notification trigger calls this
stored procedure to update the AspNet_SqlCacheTablesForChangeNotification table,
thereby indicating that the table has changed.
AspNet_SqlCacheQueryRegisteredTablesStoredProcedure :- This extracts just the table
names from the AspNet_SqlCacheTablesForChangeNotification table. It’s used to get a
quick look at all the registered tables.
AspNet_SqlCachePollingStoredProcedure :- This will get the list of changes from the
AspNet_SqlCacheTablesForChangeNotification table. It is used to perform polling.
2007-10-23, 6500👍, 0💬
Popular Posts:
The object that contains all the properties and methods for every ASP.NET page, that is built is .. ...
.NET INTERVIEW QUESTIONS - Can we use events with threading ? Yes, you can use events with thread; t...
What will be printed as the result of the operation below: main() { char *ptr = " Cisco Systems"; *p...
What is the main difference between a Vector and an ArrayList? Java Vector class is internally synch...
What Is a CAPTION Tag/Element? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells A "capti...