Answered by:
invalidoperationexception. timeout expired

Question
-
Today one of the application user complained the he is getting below error:
But i didn't find any error from SQL Server error Log. We are using SQL server 2016.
ADO.NET Exit Call
Invalidoperationexception.Timeout expired.The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached
Time 15,008ms
From filedeployer
To SQLserver1.abc.com,12345-DB1
Details DATA SOURCE=ABCMonday, August 3, 2020 11:18 AM
Answers
-
Hi Vijay,
As mentioned by other experts, this is a client raised error.
There is only two ways this exception can happen lets take a look:
1) You use more than Max Pool Size connections (Max Pool Size default=100).
2) You are leaking connections.
With ADO.NET 2.0 if you see the NumberOfReclaimedConnections performance counter go up you know that your application is leaking connections.
Solution: You need to ensure that you should close it after every time you call the connection.
Please refer more details from below:
Connection Pooling and the "Timeout expired" exception FAQ
Best Wishes
""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
For more information, please refer to the sticky post.- Marked as answer by VijayKSQL Wednesday, August 5, 2020 8:21 PM
Tuesday, August 4, 2020 2:35 AM
All replies
-
But i didn't find any error from SQL Server error Log.
Because this error isn't raised from SQL Server, it's client raised error. Often cause isn't cleanly developed code, e.g. not cleanly closed connection to put it back to connection pool.
Here you can only contact the developer/software vendor support to have a close look to.
Olaf Helper
[ Blog] [ Xing] [ MVP]Monday, August 3, 2020 11:31 AM -
Right. Since this is a client-side error you would not find any error message in the SQL Server error log.
What you could see on the SQL Server side, though, is a lot of connections from the applications.
There are two possibilities:
1) This is a busy application and there are more than 100 concurrent requests. (100 being the default pool size). In this case, the correct remedy is to increase the pool size.
2) There is an issue in the application where connections are not closed properly and returned to the pool. This must be corrected in the application.In any cases, you need to discuss this with the applicaiton team.
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Monday, August 3, 2020 11:37 AM -
Adding to the other answers, other causes of this symptom may be long-term blocking, the need for query/index tuning, or an database instance undersized for the workload. Increasing the connection pool size might help mask the problem but you should focus on identifying and remediating the root cause.
Dan Guzman, Data Platform MVP, http://www.dbdelta.com
Monday, August 3, 2020 12:14 PM -
Hi Vijay,
As mentioned by other experts, this is a client raised error.
There is only two ways this exception can happen lets take a look:
1) You use more than Max Pool Size connections (Max Pool Size default=100).
2) You are leaking connections.
With ADO.NET 2.0 if you see the NumberOfReclaimedConnections performance counter go up you know that your application is leaking connections.
Solution: You need to ensure that you should close it after every time you call the connection.
Please refer more details from below:
Connection Pooling and the "Timeout expired" exception FAQ
Best Wishes
""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
For more information, please refer to the sticky post.- Marked as answer by VijayKSQL Wednesday, August 5, 2020 8:21 PM
Tuesday, August 4, 2020 2:35 AM