【发布时间】:2009-09-23 14:21:37
【问题描述】:
这是我们得到的错误。我们将应用程序和数据库服务器从 32 位移至 x64。服务器上安装了 Framework 2.0 service pack 2。
超时。在从池中获取连接之前超时时间已过。这可能是因为所有池连接都在使用中并且已达到最大池大小。
下面是一些 DataAccess 代码,它从 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;
}
}
【问题讨论】:
标签: asp.net sql-server