Exforsys

ASP.NET 2.0

  1. Getting started with ASP.NET 2.0
  2. .NET Framework Fundamentals
  3. Microsoft.NET Framework Tools
  4. Application Development in .NET
  5. What's New in the .NET Framework 2.0 ?
  6. Introduction to Visual Studio.NET
  7. Installing Visual Studio.NET 2005
  8. Working with Visual Studio.NET Web Applications
  9. Whats New in ASP.NET 2.0
  10. Creating an ASP.NET Application
  11. ASP.NET Code Directory
  12. ASP.NET Page Object Model
  13. ASP.NET Server Controls
  14. ASP.NET Working With Master Pages
  15. ASP.NET Creating Content for Master Page
  16. ASP.NET Referencing Master Page Members
  17. ASP.NET Changing Master Pages Dynamically
  18. ASP.NET Creating Nested Master Pages
  19. ASP.NET Working with Web Parts
  20. ASP.NET Using Web Parts and Controls in Web Pages
  21. ASP.NET Web Pages and Layout
  22. ASP.NET - Adding Web Parts at Run Time
  23. ASP.NET Personalization: User Profiles and Themes
  24. ASP.NET Data Access features
  25. ASP.NET State Management
  26. ASP.NET Customizing the Session State Mechanism
  27. ASP.NET State Management And Caching
  28. ASP.NET Security
  29. Forms Authentication in ASP.NET
  30. ASP.NET Managing Membership and Roles
  31. ASP.NET Configuring Page-Level Caching
  32. ASP.NET Setting Application-Level Caching
  33. ASP.NET Data Source Object Model
  34. ASP.NET SqlDataSource Control
  35. ASP.NET Data Bound Controls
  36. ASP.NET GridView Control
  37. ASP.NET GridView Filtering
  38. ASP.NET Adding Sorting and Paging in GridView
  39. ASP.NET DataBound Controls - Details View
  40. ASP.NET Using a Grid to Display Detail Information
  41. ASP.NET Displaying Master-Detail Data on the Same Page
  42. Displaying Master-Detail Data on Separate Pages in ASP.NET
  43. ASP.NET Creating Web Wizards
  44. ASP.NET : Dynamic Image control
  45. ASP.NET Advanced Site Functionality

Ads


Home arrow Technical Training arrow ASP.NET 2.0

ASP.NET State Management And Caching Page - 2

Page 2 of 2
Author : Exforsys Inc.     Published on: 30th Aug 2005

ASP.NET State Management And Caching


Ads

6. The number of new methods added to the CacheDependency Class make it extensible.

a. DependencyDispose is a protected method that releases the resources used by the class

b. GetUniqueID is a public method that retrieves a unique string identifier for the object

c. NotifyDependencyChanged is a protected method that informs the base class that the dependency .represented by an object has changed.

..................d. SetUtcLastModified is a protected method that marks the time when a dependency
..................changes.

..................e. HasChanged is a public Boolean read only property that indicates whether the
..................dependency has changed

..................f. UtcLastModified is a public read only property that gets the time from the
..................SetUtcLastModified.

7. The CacheDependency class has been designed to support only a limited set of well known dependencies. For instance the user cannot insert code to check whether a dependency condition has been meant.

..................a. The CacheDependency object internally sets up a file monitor object and receive a call
..................from it whenever the monitored object changes. This object is called a
..................FileSystemWatcher object .

..................b. It has an event handler and establishes a link between the CacheDependency object
..................and the Cache object and its items.

..................c. An event is fired whenever the monitored object changes.

8. In addition to creating a single dependency on an entry ASP.NET Cache also aggregates dependencies. For instance, a Cache entry can be made dependent both on a file and a SQL Server table.

..................a. Custom cache dependency objects inherit CacheDependency, so the array of
..................dependencies can be extremely wide.

..................b. The AggregateCacheDependency class is built as a custom cache dependency object
..................and inherits from the CacheDependency class.

9. The SqlCacheDependency class which inherits from CacheDependency class supports dependencies on SQL Server tables.

..................a. It implements features that are compatible with MSDE, SQL Server 7.0 and subsequent
..................versions.

..................b. The class works only when the tables on which dependencies have to be created are
..................enabled.

..................c. The SqlCacheDependency class has two constructors. The first takes the
..................SqlCommand object and the second accepts two strings—the database name and
..................the table name.

.............................i. The SqlCacheDependency class sets up a dependency relationship with SQL
................................Server 2005 known as command notification.

.............................ii. Whenever there are changes in the tables involved the notification is sent to the
.................................caller.

.............................iii. The caller then handles the event and lets the parent know through the
.................................. NotifyDependencyChanged.

..................d. Triggers and stored procedures will have to be created to handle any incoming
..................UPDATE, INSERT and DELETE statements.

..................e. This must be done before the application is published.

..................f. The command line tool aspnet_regsqlcache or the methods of
..................SqlCacheDependencyAdmin can be used to enable the database for notifications.

..................g. The database entry is to be bound to a connection string entry

..................h. The poll component then, accesses the newly created table to see whether other tables
..................have changed.

..................i. If one or more tables have to be monitored for changes they can be added to a list
..................programmatically by defining a trigger on the table that is sensitive to insert, updates and
..................deletions. The trigger can increment the value of the ChangeID column.

Ads

j. A key architectural component is the cache dependency manager object. This component accesses the table and reads the ChangeID field and informs the corresponding cache object if a change has occurred.

k. The cache dependency object is dependent on a helper cache key, whose name is defined in accordance with the table and the database. This helper cache entry is removed so that the original SqlCacheDependency object is invalidated.

Read Next: ASP.NET Security


 
This tutorial is part of a ASP.NET 2.0 tutorial series. Read it from the beginning and learn yourself.

ASP.NET 2.0

  1. Getting started with ASP.NET 2.0
  2. .NET Framework Fundamentals
  3. Microsoft.NET Framework Tools
  4. Application Development in .NET
  5. What's New in the .NET Framework 2.0 ?
  6. Introduction to Visual Studio.NET
  7. Installing Visual Studio.NET 2005
  8. Working with Visual Studio.NET Web Applications
  9. Whats New in ASP.NET 2.0
  10. Creating an ASP.NET Application
  11. ASP.NET Code Directory
  12. ASP.NET Page Object Model
  13. ASP.NET Server Controls
  14. ASP.NET Working With Master Pages
  15. ASP.NET Creating Content for Master Page
  16. ASP.NET Referencing Master Page Members
  17. ASP.NET Changing Master Pages Dynamically
  18. ASP.NET Creating Nested Master Pages
  19. ASP.NET Working with Web Parts
  20. ASP.NET Using Web Parts and Controls in Web Pages
  21. ASP.NET Web Pages and Layout
  22. ASP.NET - Adding Web Parts at Run Time
  23. ASP.NET Personalization: User Profiles and Themes
  24. ASP.NET Data Access features
  25. ASP.NET State Management
  26. ASP.NET Customizing the Session State Mechanism
  27. ASP.NET State Management And Caching
  28. ASP.NET Security
  29. Forms Authentication in ASP.NET
  30. ASP.NET Managing Membership and Roles
  31. ASP.NET Configuring Page-Level Caching
  32. ASP.NET Setting Application-Level Caching
  33. ASP.NET Data Source Object Model
  34. ASP.NET SqlDataSource Control
  35. ASP.NET Data Bound Controls
  36. ASP.NET GridView Control
  37. ASP.NET GridView Filtering
  38. ASP.NET Adding Sorting and Paging in GridView
  39. ASP.NET DataBound Controls - Details View
  40. ASP.NET Using a Grid to Display Detail Information
  41. ASP.NET Displaying Master-Detail Data on the Same Page
  42. Displaying Master-Detail Data on Separate Pages in ASP.NET
  43. ASP.NET Creating Web Wizards
  44. ASP.NET : Dynamic Image control
  45. ASP.NET Advanced Site Functionality
 

Comments