I\'ve recently started to use the Entity Framework 4.0 in my .NET 4.0 application and am curious about a few things relating to pooling.
Connection pooling
According to Daniel Simmons:
Create a new ObjectContext instance in a Using statement for each service method so that it is disposed of before the method returns. This step is critical for scalability of your service. It makes sure that database connections are not kept open across service calls and that temporary state used by a particular operation is garbage collected when that operation is over. The Entity Framework automatically caches metadata and other information it needs in the app domain, and ADO.NET pools database connections, so re-creating the context each time is a quick operation.
This is from his comprehensive article here:
http://msdn.microsoft.com/en-us/magazine/ee335715.aspx
I believe this advice extends to HTTP requests, so would be valid for ASP.NET. A stateful, fat-client application such as a WPF application might be the only case for a "shared" context.