Entity Framework - Affect of MultipleActiveResultSets on Caching

c# entity-framework

Popular Answer

With the help of the Many Active Result Sets (MARS) functionality in SQL 2005/2008 and ADO.NET, multiple active result sets can share a single connection (Just as the name implies). If your problem persists, try turning this off in the connection string and watching how the app behaves. I'm assuming that this is the likely source of your issue. For additional information on MARS, visit the MSDN link below.

Multiple Active Result Sets (MSDN)

Edit: Try:

var results = context.SomeEntitiy.AsNoTracking() where this = that select s;

AsNoTracking() disables entity internal change tracking and ought to necessitate frequent entity reloads in Entity Framework.

After all is said and done, you will need to refactor a little bit because your code clearly has a design issue.

3
7/7/2016 2:04:42 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow