Quantcast
Channel: entityframework Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1793

New Post: Caching and lazy loaded parent-child relationships

$
0
0
Hi,
I asked a question on stackoverflow already, and haven't seen any comments, so I thought I'd ask a simpler question here.

If I cache data that came from EF (parent table), will the lazy-loaded child data work correctly if multiple threads are trying to access children, which are not loaded yet?

Let me elaborate - we are storing a list of a class in cache, and sometimes children of that class are accessed. That child access can happen at the same time in parallel threads, which is actually quite likely when app pool is restarted on web server.

What I see in linq is that it's broken. I think it may be broken same way in EF, because data context is carried with data and is not thread safe.

Can someone at least confirm/deny my gut feeling?

The original post is here:
http://stackoverflow.com/questions/17885906/caching-linq-sql-objects-and-datacontext-thread-safety

Viewing all articles
Browse latest Browse all 1793

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>