- Windows 7 Proffesioanal
- IIS 7.5
- ASP .NET MVC
- SQL Express 2012 (11.0.3128)
Very often an error appears The timeout expired before it could obtain a connection from the pool. Perhaps all connections in the pool are already in use and the maximum pool size.
in System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
1. It ended up pooled connections working with SQL?
2. What are the limits of these connections?
3. If the difference in versions of Windows (including server)?
4. To specify the time of restarting the pool the only way?
Judging from the error pool database. Most likely you are close conections to the database. You need to follow the following rules:
1) Opened connection
2) Executed the query
3) Closed the connection
And then such mistakes will not be
Better yet, use a using. Then the closing will occur automatically
haven_Wo answered on October 3rd 19 at 01:29
Option - use an ORM like EntityFramework, for example.
I have, by the way this was on 2008R2 server with EF
when the base was opened in the embedded browser of the database in the Studio + it also runs in SQL Management Studio I tried to run the project for work/testing in the browser received such a thing.
Then set up CodeFirst Migrations and all DB climb stopped