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 as I know is managed by the ADO.NET data provider, in my case that of MS SQL server. Does this apply when you instantiate a new entities context (
ObjectContext
), i.e. the parameterlessnew MyDatabaseModelEntities()
? -
What are the advantages and disadvantages of a) creating a global entities context for the application (i.e. one static instance) or b) creating and exposing an entities context for each given operation/method, with a
using
block. -
Any other recommendations, best practices, or common approaches for certain scenarios that I should know about?