1

Possible Duplicate:
Entity Framework and Connection Pooling

Does EF1 support Connection Pooling? If yes, what we need to do to manage it?

Community
  • 1
  • 1
Riz
  • 5,848
  • 16
  • 59
  • 79
  • 2
    What is the DB server? In particular, `SqlClient` (in ADO.NET) will handle pooling a few layers down for the SQL-Server case... – Marc Gravell Jul 26 '11 at 12:12
  • 1
    Check this question: http://stackoverflow.com/questions/3653009/entity-framework-and-connection-pooling It is same for EFv1 and SQL server. – Ladislav Mrnka Jul 26 '11 at 12:16

3 Answers3

1

I don't think you need to do anything except to make sure your connection string throughout the application stays the same. .NET will take care of the rest herself.

Kon
  • 25,664
  • 11
  • 56
  • 84
  • This depends on what the server is, as this is determined by the specific implementation - not automatically in ADO.NET. – Marc Gravell Jul 26 '11 at 12:13
  • Considering the tags asp.net AND entity-framework, the assumption is that we're talking about MS SQL Server. – Kon Jul 26 '11 at 12:15
  • why? ASP.NET and EF work on a *range* of databases... that being one of the key design choices between EF and L2S... it is an *options*, but it isn't known (and frankly, the DB vendor is a lot more important than the ASP.NET in this) – Marc Gravell Jul 26 '11 at 12:28
  • Let's just say that was my assumption/intuition. ok? – Kon Jul 26 '11 at 12:30
  • @Kon, Yes, I am using SQL Server 2008. Any link where I can read more about this auto pooling done by EF or ADO.Net ? – Riz Jul 26 '11 at 13:42
  • http://stackoverflow.com/questions/3653009/entity-framework-and-connection-pooling – Kon Jul 26 '11 at 14:12
1

Connection pooling is supported by EF and it is default. If you want to change it you can alter Pooling parameter in the connection string true or false.

maniacneron
  • 414
  • 6
  • 19
0

Assuming SQL Server, somewhere underneath the EF code, a SqlConnection is created using a connection string. A pool of connections will be created per connection string.

It should simply work, without any code / config on your side

Matt Evans
  • 6,601
  • 7
  • 29
  • 60