Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
System.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.
   at Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0)
   at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   at Devart.Common.DbConnectionBase.Open()
   at Devart.Data.Oracle.OracleConnection.Open()
   at EasyCredit.Service.CustomerDetails.CustomerDetailsService.<SaveMailBodyForCasaVR>d__104.MoveNext()
--------------------------------------------------------------   at Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0)
   at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   at Devart.Common.DbConnectionBase.Open()
   at Devart.Data.Oracle.OracleConnection.Open()
   at EasyCredit.Service.CustomerDetails.CustomerDetailsService.<SaveMailBodyForCasaVR>d__104.MoveNext()


What I have tried:

Getting this exception in the project. I have given 300 pool size in the web.config but still getting the exception of connection from the pool
Posted
Updated 15-Jan-20 4:31am
Comments
F-ES Sitecore 15-Jan-20 10:03am    
If you don't have long-running processes, just make sure you are disposing of connections when you use them.
ZurdoDev 15-Jan-20 10:34am    
What they said. ^

The most common cause of this is not properly disposing of connection object when you're done using them. The pattern for database use is to create and open as late as possible, do your database work, then close and dispose the connection as early as possible.

If you've got classes that open a connection for use anywhere in the class, this is a bad thing. Consumers of these classes typically don't call Dispose on them, and the classes themselves don't properly close and dispose of the connections, leaving them open for the lifetime of the class instance. When your instances go out of scope, this does not mean they have disposed of the resources they are using. They can hang around for quite some time, hogging resources, like database connections.
 
Share this answer
 
The error message tells you why your app crashed.
Now you have to add code to track what is going on in the pool.
I would log all pool requests and releases with time of operation and availability in pool.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900