开发者

Why am I getting this error "Internal connection fatal error" in only one of my stored procedures?

开发者 https://www.devze.com 2023-01-19 17:05 出处:网络
This issue is similiar to here. What Causes "Internal connection fatal errors" Except it\'s only happening on one stored procedure and is happening all of the time and is only happening wh

This issue is similiar to here.

What Causes "Internal connection fatal errors"

Except it's only happening on one stored procedure and is happening all of the time and is only happening when I access this stored procedure from my website.

I've even ran the stored procedure 开发者_JAVA百科in SQL Server and it seems to execute fine.

What could possibly be the error?


As the message say, the problem is on connection to SQL.

Because its happends only to one procedure then my quest is that you have left some open connection to database just before try to call this store procedure.

You can check the connection by turn on Perfmon and see the connection pool. If its growing over time then you left open connections.

Also check if your network is stable, you are over Lan, Wan, web, local or remote ? In the connection string what do you use of this: 127.0.0.1 / localhost / or the real ip address ?.


This was probably already fixed but...

I ran into this same issue with some of my own ASP.NET code. The exception was being thrown randomly when calling SqlDataReader.Close() or SqlDataReader.Dispose() (from an internal class SqlClient.TdsParser).

I was able to resolve the problem by simply using SqlConnection.Close() instead. Apparently SqlDataReader.Close() is just unreliable.

Example:

if (this._Command != null)
{
  this._Command.Cancel();
  this._Command.Dispose();
}
if (this._Connection.State == ConnectionState.Open)
{
  this._Connection.Close();
}
if (this._DataReader != null)
{
  this._DataReader.Dispose();
}
this._Connection.Dispose();
0

精彩评论

暂无评论...
验证码 换一张
取 消