title: LIfetime management of Dbcontext using Unity with ThreadPool
body: <p>I'm currently building an ASP.NET MVC application with Unity and Entity framework. I'm using the Unity MVC 3 setup where it uses the ContainerControlledLifetimeManager to resolve the dependency (http://devtrends.co.uk/blog/introducing-the-unity.mvc3-nuget-package-to-reconcile-mvc3-unity-and-idisposable). This works fine until I try to spin up another thread that executes a time-consuming task after the page is loaded, and the user receives updates. From the thread, I get this error:</p>
  
  <p><code>The operation cannot be completed because the DbContext has been disposed.</code></p>
  
  <p>I believe it's because the main thread has completed so the container and it's children gets disposed. Does anyone know of a solution for this?</p>
  
  <p>Thanks!</p>