I prefer not to use EF whenever possible. I worked with it in several projects and it was such a PITA that I just gave up on it.
DbContext and ObjectContext are not thread-safe. Thus it will always be a problem if you share the same instance of a context across incoming requests.
The HierarchicalLifetimeManager is mostly the same as the ContainerControlledLifetimeManager
so your context will have a singleton lifetime but should be disposed when the (child) container that was used to create it gets disposed (as is done inside their custom
HttpModule). For an
overview of the built-in LifetimeManagers have a look at this post.
I'm not sure how good or bad Unity.Mvc3 is at handling multi-threading. I'm not a multi-threading guru myself. But if something goes wrong with the creation of child containers for each new request you might end up with a shared container which
returns some shared instance of the context.
In short: I can't really help you here, sorry.
Btw: LifetimeManagers that clean up after themselves are on the
wish-list for Unity vNext