Page 1 of 1

Timeout Period Elapsed

Posted: Thu 29 Aug 2013 21:44
by starrtec

Getting the following exception after a network outage between client and server.

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.PostgreSql.PgSqlConnection.Open()
at StarrPos.Common.Src.Db.PostGreSqlIO.DBConnection(ConnectionType ct, String host)

Attempting to clear connection pool once this exception is detected does not resolve the issue.
Only successful resolution is to stop the client and restart.
Note: Client is running as a service.
I believe all connections are being closed after access.

Running Devart.Data.Dll 5.0.735.0 and Devart.Data.PostgreSql.Dll on various versions of windows.

Re: Timeout Period Elapsed

Posted: Fri 30 Aug 2013 13:52
by Pinturiccio
This exception occurs when the number of open connections is equal to the MaxPoolSize property value. So, there are no unused connections in the pool, otherwise, when opening a connection, it would have been taken from the pool and the exception would not have occurred.
starrtec wrote:I believe all connections are being closed after access.
This exception can occur when you use simultaneously more connections than it is specified in the MaxPoolSize value, i.e. if you have MaxPoolSize = 100, and you have 100 open connections, all of them are used and none of them have been closed yet, then, when opening the 101st connection, we will get the specified exception. In this case clearing the pool will not help, as this method clears the pool of unused connections present in the pool, but doesn't affect the open connections.

If you think your connections are closed and the error is caused by the connection failure, create and send us a small test project with the corresponding DDL/DML scripts for reproducing the issue.

Please also send us the steps for reproducing the issue.

Re: Timeout Period Elapsed

Posted: Mon 02 Sep 2013 04:04
by starrtec
Test program supplied.

Re: Timeout Period Elapsed

Posted: Mon 02 Sep 2013 13:59
by Pinturiccio
We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.

Re: Timeout Period Elapsed

Posted: Wed 04 Sep 2013 12:22
by Pinturiccio
We have fixed the bug with an error occurring during opening a connection, and then this connection getting into the pool. We will post here when the corresponding build of dotConnect for PostgreSQL is available for download.

Re: Timeout Period Elapsed

Posted: Fri 06 Sep 2013 08:21
by Pinturiccio
The new build of dotConnect for PostgreSQL 6.8.322 is available for download now!
It can be downloaded from ... nload.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to