By pass cached data


  • When I access data with the Entity framework I get cached data. How can I control if the data comes from the cache or SQL server?
    I use Entity framework version 5, .net 4.5 and SQL server 2008 R2.

    Certified Geek

    Monday, January 13, 2014 7:40 PM


All replies

  • Hello,

    >>How can I control if the data comes from the cache or SQL server?

    What do you mean “control”?

    Is it that you want to control where the data comes from, cache or database?

    If it is, in Entity Framework, data will always first come from database and then is stored in cache, and then we do some CRUD operations on cache data, after we call SaveChange() method, then the changes will be updated to database.

    Or is it that you want to “control” data to do some CRUD operations with the data?

    If it is, you can refer to the link below:


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, January 14, 2014 3:03 AM
  • I have a mixed environment.
    1. I create a record with Entity Framework
    2. I call a stored procedure that updates that same record that I have in entity framework Cache.
    3. I try to update the same record with Entity Framework. I get the record from entity framework cache and I loose the changes that were done with a stored procedure.

    Certified Geek

    Tuesday, January 14, 2014 4:40 PM
    • Marked as answer by Arne MN Wednesday, January 15, 2014 4:01 PM
    Tuesday, January 14, 2014 10:55 PM