このエラーが発生し、アプリケーションが動作を停止します。 Timeout expired.
プールから接続を取得するまでのタイムアウト時間。 プールされた接続がすべて使用されていて、最大プールサイズに達したために発生した可能性があります。接続リークが原因でタイムアウトになります。プールから接続を取得する前にタイムアウト時間が経過していますか?
しかし、私は最大接続プールに達していません。私はRDSを持っており、私のモニタリングページでは、このエラーが発生したときの接続数は33であり、最大値はデフォルトで100であることがわかりました。
これは、私の接続のリークが原因である可能性があります。
ここには、データベースに接続するために使用しているDBLayer
クラスがあります。
public static DataTable GetDataTable(SqlCommand command, IsolationLevel isolationLevel = IsolationLevel.ReadUncommitted)
{
using (new LoggingStopwatch("Executing SQL " + command.CommandText, command.Parameters))
{
using (var connection = new SqlConnection(connectionString))
using (var dataAdapter = new SqlDataAdapter(command))
{
command.Connection = connection;
command.CommandTimeout = ShopexConfiguration.SqlTimeout;
connection.Open();
var transaction = connection.BeginTransaction(isolationLevel);
command.Transaction = transaction;
try
{
var result = new DataTable();
dataAdapter.Fill(result);
transaction.Commit();
return result;
}
catch
{
try
{
transaction.Rollback();
}
catch (Exception)
{
//
// This catch block will handle any errors that may have occurred
// on the server that would cause the rollback to fail, such as
// a closed connection.
}
throw;
}
}
}
}
これは接続リークの原因になりますか?すべてのヘルプは高く評価され
:
私はこのブログを見たことがありますか?
これは長引くかもしれませんが、サーバー*でユーザー1人あたりの開かれた接続数には制限がありますか? –