nerdexam
Microsoft

70-518 · Question #57

You are developing an application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010. The application contains a grid that displays customer data stored in a database table. Users…

The correct answer is A. CacheDependency class: it's a filewatcher one => out. Improve loading time for the grid. You need to ensure that the cached data expires when the customer data is updated. You can use the CacheItemPolicy to specify expiration policies. page 190 => Yes needs to be active to observe changes to any entities you are actively working…

Developing Data Access

Question

You are developing an application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010. The application contains a grid that displays customer data stored in a database table. Users report that the grid takes a long time to display. You plan to implement data caching to improve loading time for the grid. You need to ensure that the cached data expires when the customer data is updated. What should you do?

Options

  • ACacheDependency class: it's a filewatcher one => out
  • BRuntime.Caching.SqlChangeMonitor: class Monitors changes to a database.
  • CUse the ADO.NET Entity Framework: I wouldn't advise it (caching Entity). The ObjectContext
  • DUse a static variable to store the Grid object: Won't help to impove loading time => out

How the community answered

(30 responses)
  • A
    77% (23)
  • B
    3% (1)
  • C
    13% (4)
  • D
    7% (2)

Explanation

Improve loading time for the grid. You need to ensure that the cached data expires when the customer data is updated. You can use the CacheItemPolicy to specify expiration policies. page 190 => Yes needs to be active to observe changes to any entities you are actively working with or you'd need to disconnect any active entities prior to caching the ObjectContext. Detaching could work provided the original context is disposed properly => out SqlChangeMonitor -> monitor change in database

Topics

#SqlChangeMonitor#data caching#cache invalidation#SQL dependency

Community Discussion

No community discussion yet for this question.

Full 70-518 Practice