In connection to the database I use a pool of connections and Firebird database. I use FirebirdSql.Data.FirebirdClient version 2.6.5.0. I have the following connection string:
<add name="db" connectionString="Server=***;user
id=***;password=***;Charset=ANSI_CHARSET;Database=***;
Connection lifetime=15;Pooling=true;MinPoolSize=0;MaxPoolSize=10"
providerName="FirebirdSql.Data.FirebirdClient" />
I have the following code that uses the connection to the database:
IEnumerable<Orders> ord = new List<Orders>();
using(FbConnection fbCon = new FbConnection("my connection string"))
{
fbCon.Open();
using(FbCommand command = fbCon.CreateCommand())
{
command.CommandText = "SELECT first 100 ID, SYMBOL, NUMBER, POS FROM Z1";
Debug.WriteLine(string.Format("Before Close: {0}", FirebirdSql.Data.FirebirdClient.FbConnection.GetPooledConnectionCount(fbCon)));
ord= command.ExecuteReader(CommandBehavior.CloseConnection).ConvertToList<Orders>();
}
}
However, I receive error:
Timeout exceeded.
at FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckMaxPoolSize ()
at FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckOut ()
at FirebirdSql.Data.FirebirdClient.FbConnection.Open ()
Error is caused by reaching MaxPoolSize ... every time when I call the above code, in the Output window I ancillary message:
Before Close: 1
Before Close: 2
...
Before Close: 10