這是我們正在收到的錯誤。我們將應用程序和數據庫服務器從32位移至x64。 Framework 2.0 Service Pack 2安裝在服務器上。超時過期:連接池
超時已過期。在從池中獲取連接之前已超時。發生這種情況的原因可能是因爲所有連接池都在使用中,並且達到最大池大小。
下面是數據訪問一些代碼,從try塊內返回一個值:
public string GetSomething()
{ var a = String.Empty;
try
{
// loop through the datareader
return "some data";
}
finally
{
reader.close();
}
return whatever;
}
這裏是打開和管理方面,一些代碼:
public DBHelper(IDbCommand command)
{
this.command = command;
if (command.Connection.State == ConnectionState.Open)
{
shouldCloseConnection= false;
}
else
{
command.Connection.Open();
shouldCloseConnection= true;
}
}
原來這是一個基本庫中的連接泄漏。 – azamsharp 2009-09-24 18:25:13