By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,446 Members | 3,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,446 IT Pros & Developers. It's quick & easy.

Need advice for tracking down a general network error exception

P: n/a
I have an application installed at a customer site that has been getting a
general network error for a couple of years. I was hoping that .NET 2.0
would clear it up, but unfortunately it didn't. The .NET 2.0 exception does
give a little more info than .NET 1.1 did, but not much.

Can anybody give any pointers about how to track this down? It occurs every
10 hrs around the clock, like clockwork.

I have included the stack trace, but omitted the trace from my code. The
application is attempting to fill a dataset from a SQL Server 2000 box. The
frequency at which it attempts this is customer defined, but I believe it is
doing it every minute. There are other applications at the customer site
using that server. It is not possible to disable them, as they run their
business. Haven't been able to duplicate this error inhouse.

Thanks.

-- Alan
System.Data.SqlClient.SqlException: A transport-level error has occurred
when sending the request to the server. (provider: Named Pipes Provider,
error: 0 - An unexpected network error occurred.)
Source: .Net SqlClient Data Provider
HResult: -2146232060 (0x80131904)
Errors Collection:
-------------------------------------
Class: 20
LineNumber: 0
Message: A transport-level error has occurred when sending the request to
the server. (provider: Named Pipes Provider, error: 0 - An unexpected
network error occurred.)
Number: 59
Procedure:
Server: xxxx2K3012
Source: .Net SqlClient Data Provider
State: 0
ErrorCode: -2146232060

System.Data.SqlClient.SqlException: A transport-level error has occurred
when sending the request to the server. (provider: Named Pipes Provider,
error: 0 - An unexpected network error occurred.)
at System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception,
Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, Boolean breakConnection)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject
stateObj)
at System.Data.SqlClient.TdsParserStateObject.ThrowEx ceptionAndWarning()
at System.Data.SqlClient.TdsParserStateObject.WriteSn i()
at System.Data.SqlClient.TdsParserStateObject.WritePa cket(Byte flushMode)
at System.Data.SqlClient.TdsParserStateObject.Execute Flush()
at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_Sql RPC[] rpcArray,
Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest,
TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderT ds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,
DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataRead er(CommandBehavior
behavior)
at
System.Data.Common.DbCommand.System.Data.IDbComman d.ExecuteReader(CommandBehavior
behavior)
at System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
Jan 18 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Alan,

If I see this, than I have forever to think about backupprocesses.

You are sure that such a kind of process is not interfering your application
and the standards it assumes.

As at least Bill Vaughn and I as well have seen is, that you can have this
kind this kind of problems even from a not good working light bulb or an
antenna from a car which is leaving the garage and hits the building.

Just a thought,

Cor
Jan 18 '06 #2

P: n/a
On Wed, 18 Jan 2006 01:19:50 -0600, "Alan Pretre" <no@spam> wrote:

I have an application installed at a customer site that has been getting a
general network error for a couple of years. I was hoping that .NET 2.0
would clear it up, but unfortunately it didn't. The .NET 2.0 exception does
give a little more info than .NET 1.1 did, but not much.

Can anybody give any pointers about how to track this down? It occurs every
10 hrs around the clock, like clockwork.


The problem is network or database server related. It could be a temporary loss of network
connectivity or that the database server is temporarily unavailable and cannot handle the request.

Someone needs to monitor the network traffic and the database server in order to determine what
might be happening when this error occurs.
Paul
~~~~
Microsoft MVP (Visual Basic)
Jan 18 '06 #3

P: n/a
I could be wrong, but it looks like you keep the connection open all the
time, better would be to open the connection for each request. That would
give you more control to handle connection problems whenever they happen.
Another thing to watch for is wheter SQL is not scheduled for unattended
off-line back-ups. And a last question is why you are using a named pipe
transport protocol instead of TCP?

Willy.

"Alan Pretre" <no@spam> wrote in message
news:ez****************@TK2MSFTNGP11.phx.gbl...
|I have an application installed at a customer site that has been getting a
| general network error for a couple of years. I was hoping that .NET 2.0
| would clear it up, but unfortunately it didn't. The .NET 2.0 exception
does
| give a little more info than .NET 1.1 did, but not much.
|
| Can anybody give any pointers about how to track this down? It occurs
every
| 10 hrs around the clock, like clockwork.
|
| I have included the stack trace, but omitted the trace from my code. The
| application is attempting to fill a dataset from a SQL Server 2000 box.
The
| frequency at which it attempts this is customer defined, but I believe it
is
| doing it every minute. There are other applications at the customer site
| using that server. It is not possible to disable them, as they run their
| business. Haven't been able to duplicate this error inhouse.
|
| Thanks.
|
| -- Alan
|
|
| System.Data.SqlClient.SqlException: A transport-level error has occurred
| when sending the request to the server. (provider: Named Pipes Provider,
| error: 0 - An unexpected network error occurred.)
| Source: .Net SqlClient Data Provider
| HResult: -2146232060 (0x80131904)
| Errors Collection:
| -------------------------------------
| Class: 20
| LineNumber: 0
| Message: A transport-level error has occurred when sending the request
to
| the server. (provider: Named Pipes Provider, error: 0 - An unexpected
| network error occurred.)
| Number: 59
| Procedure:
| Server: xxxx2K3012
| Source: .Net SqlClient Data Provider
| State: 0
| ErrorCode: -2146232060
|
| System.Data.SqlClient.SqlException: A transport-level error has occurred
| when sending the request to the server. (provider: Named Pipes Provider,
| error: 0 - An unexpected network error occurred.)
| at System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception,
| Boolean breakConnection)
| at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
| exception, Boolean breakConnection)
| at
|
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject
| stateObj)
| at System.Data.SqlClient.TdsParserStateObject.ThrowEx ceptionAndWarning()
| at System.Data.SqlClient.TdsParserStateObject.WriteSn i()
| at System.Data.SqlClient.TdsParserStateObject.WritePa cket(Byte
flushMode)
| at System.Data.SqlClient.TdsParserStateObject.Execute Flush()
| at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_Sql RPC[] rpcArray,
| Int32 timeout, Boolean inSchema, SqlNotificationRequest
notificationRequest,
| TdsParserStateObject stateObj)
| at System.Data.SqlClient.SqlCommand.RunExecuteReaderT ds(CommandBehavior
| cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
| at System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior
| cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,
| DbAsyncResult result)
| at System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior
| cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
| at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
| behavior, String method)
| at System.Data.SqlClient.SqlCommand.ExecuteDbDataRead er(CommandBehavior
| behavior)
| at
|
System.Data.Common.DbCommand.System.Data.IDbComman d.ExecuteReader(CommandBehavior
| behavior)
| at System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset,
| DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
| srcTable, IDbCommand command, CommandBehavior behavior)
| at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
| startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
| CommandBehavior behavior)
| at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
|
|
Jan 18 '06 #4

P: n/a

"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:em**************@TK2MSFTNGP11.phx.gbl...
I could be wrong, but it looks like you keep the connection open all the
time, better would be to open the connection for each request. That would
give you more control to handle connection problems whenever they happen.
Another thing to watch for is wheter SQL is not scheduled for unattended
off-line back-ups. And a last question is why you are using a named pipe
transport protocol instead of TCP?


Thanks, I am investigating the connection pooling situation. I was able to
track down this article, it may apply to me.

http://support.microsoft.com/default...b;en-us;328476

I don't knowingly have connection pooling disabled.

-- Alan
Jan 18 '06 #5

P: n/a
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:em**************@TK2MSFTNGP11.phx.gbl...
I could be wrong, but it looks like you keep the connection open all the
time, better would be to open the connection for each request. That would
give you more control to handle connection problems whenever they happen.
I have checked my connection string (not as obvious as it would seem, as it
is dynamically created), it looks like this:

user id=xxx ;password=xxx ;initial catalog=xxx ;data source=xxx;Connect
Timeout=15

I do not have Pooling=false in there.

I came across this article:

ADO.NET Connection Pooling FAQ
http://www.c-sharpcorner.com/Code/20.../PoolingNS.asp

In the section, "Tips and Tricks for better use of connection pooling", he
says this:

"Do not close all your connections in the pool, keep at least one
connection alive."

I wonder if this is my problem. Should I have an unused connection that is
always connected during the lifetime of the app, in addition to the ones
that I have now?
Another thing to watch for is wheter SQL is not scheduled for unattended
off-line back-ups.
This was a concern, but we have verified that they are not running backups
every 10 hrs.
And a last question is why you are using a named pipe transport protocol
instead of TCP?


Not sure about the answer to this one, I'll have to look into it. The
connection string I use is generated by a component from another group in my
company. (It is not static).
-- Alan
Jan 18 '06 #6

P: n/a

"Alan Pretre" <no@spam> wrote in message
news:OZ**************@TK2MSFTNGP14.phx.gbl...
|
| "Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
| news:em**************@TK2MSFTNGP11.phx.gbl...
| >I could be wrong, but it looks like you keep the connection open all the
| > time, better would be to open the connection for each request. That
would
| > give you more control to handle connection problems whenever they
happen.
| > Another thing to watch for is wheter SQL is not scheduled for unattended
| > off-line back-ups. And a last question is why you are using a named pipe
| > transport protocol instead of TCP?
|
| Thanks, I am investigating the connection pooling situation. I was able
to
| track down this article, it may apply to me.
|
| http://support.microsoft.com/default...b;en-us;328476
|
| I don't knowingly have connection pooling disabled.
|
| -- Alan
|
|

Connection pooling is on by default, the question remains however; do you
close the connection in the application yes or no? If you don't, you keep a
logical connection from the pool and this one keeps a physical connection
with SQL. In this case, the problem starts when the physical connection
breaks for one another reason, whenever you issue the fill request (on the
logical connection), an exception will be thrown on you. If however, you
close the logical connection after each 'transaction' and re-open the
logical connection at the start of the next one, the pool manager will pass
you an 'established' physical connection from the pool, not a broken one.
Of course this doesn't explain why a connection fails at regular intervals,
my experience is scheduled activities in the server running SQL,
synchronizing DNS servers and SQL in fail-over clusters.

About the KB article all I can say is that it applies to TCP protocol
connections, but you are using named pipes and my question was if you did
have any specific reason for that?
I also have no idea about your network infrastructure, how is the client
connected? through a switched network? are routers involved (take care here
with named pipes!).
What about the server, how many connections are there configured for SQL and
how many are there used at any time.

Willy.
Jan 18 '06 #7

P: n/a
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:O6**************@TK2MSFTNGP10.phx.gbl...
Connection pooling is on by default, the question remains however; do you
close the connection in the application yes or no? If you don't, you keep
a
logical connection from the pool and this one keeps a physical connection
with SQL. In this case, the problem starts when the physical connection
breaks for one another reason, whenever you issue the fill request (on the
logical connection), an exception will be thrown on you. If however, you
close the logical connection after each 'transaction' and re-open the
logical connection at the start of the next one, the pool manager will
pass
you an 'established' physical connection from the pool, not a broken one.
Of course this doesn't explain why a connection fails at regular
intervals,
my experience is scheduled activities in the server running SQL,
synchronizing DNS servers and SQL in fail-over clusters.
This would be a typical fill. Note the Connection usage. Is this closing
the logical or physical connection?

public int Fill() {
int NumRows = 0;

using (System.Data.SqlClient.SqlConnection Connection = new
System.Data.SqlClient.SqlConnection(_Connection.Co nnectionString)) {
Connection.Open();

using (cfgDevicesDataAdapter daDevices = new
cfgDevicesDataAdapter(Connection)) {
if (_Timeout >= 0) {
daDevices.CommandTimeout = _Timeout;
} else {
daDevices.ResetCommandTimeout();
}

// Specify all records, sort on DeviceName.
daDevices.All("DeviceName ASC");

// Read the records.
if (Connection.State == System.Data.ConnectionState.Open) {
bool OldEnforceConstraints = EnforceConstraints;
EnforceConstraints = false;
NumRows += daDevices.Fill(this);
EnforceConstraints = OldEnforceConstraints;
}
}
}

return NumRows;
}

I think I will need to add some retry logic around the Connection.Open().
About the KB article all I can say is that it applies to TCP protocol
connections, but you are using named pipes and my question was if you did
have any specific reason for that?
There is no good answer to this, I have already brought it up with the group
responsible for creating the connection string the possibility of either
defaulting or allowing the protocol to be specified. Right now, it is
simply unspecified, which I gather uses whatever the SQL Server is defaulted
to.
I also have no idea about your network infrastructure, how is the client
connected? through a switched network? are routers involved (take care
here
with named pipes!).
What about the server, how many connections are there configured for SQL
and
how many are there used at any time.


This stuff is a little hard to find out, as the sites are scattered around
the United States and other employees here do the installs. If I can get
this connection pooling stuff straightened out, and this TCP protocol
specified, maybe those are good avenues to pursue at this point.
Did you see my other post, where I asked the question about leaving another
"unused" connection open all the time?

-- Alan
Jan 18 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.