Entity Framework - closure of Object Contexts
entity-framework, entity-framework-4.3.1
Solution
If you're not using an IoC container is there anyway you can close the ObjectContexts manually after each request, for example in the End Request of your Global.asax, thereby simulating a "per request" lifestyle for your contexts?
Problem
After using EFProfiler (absolutely fantastic tool BTW!) for profiling a few of our Entity Framework applications, it seems that, in most cases, all of the Object Contexts are not closed. For example, after running it locally, EF Profiler told me that there were 326 Object Context's opened, yet only 1 was closed? So my question is, should I worry about this? Or is it self-contained within Entity Framework?