General network error when making asynchronous calls to long sql

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get a general network error when I try to make asynchronously call
ExecuteNonQuery on long sql statements that run in parallel.

Here is the background info on what I'm trying to accomplish:
I have a sql file with two long T-SQL batches, each of which contains about
50 thousand simple insert statments into 2 non-indexed tables. Batch 1
inserts into Table 1 and batch 2 inserts into Table 2, so they can run in
parallel. I parse each batch from the file into 2 long sql-statement strings
and asynchronously call ExecuteNonQuery on them.

What I am encountering is that whenever I make the batch do more than about
50 thousand inserts, I get a GENERAL NETWORK ERROR. If I decrease the amount
of sql statements, say 40 thousand, the errors disappear. I am using SQL2005
with VS2003 and TCP/IP network connections, and I get this issuse when I use
my local machine or a faster 64bit processor server machine.

Thanks for any help you can provide.
 
It was always giving me the error message when the command took longer than
30 seconds, which I now realize is the default for the timeout. I increased
the CommandTimeout and now everything is ok.

Why then was I getting "General Network Error"? I consistenly got this
error but on a few occasions I would get the "Timeout expired" error ("The
timeout period elapsed prior to completion of the operation or the server is
not responding"). Is this a bug?
 
Hello, Yong!

Y> Why then was I getting "General Network Error"? I consistenly got this
Y> error but on a few occasions I would get the "Timeout expired" error
Y> ("The timeout period elapsed prior to completion of the operation or the
Y> server is not responding"). Is this a bug?

IMO it is not a bug. The errors you've got are from 2 different sources.
"General Network Error" server timeout for the connection. ( tcp/ip timeout etc )
"The timeout period elapsed prior to completion of the operation or the server is not responding"
is generated with the db access library.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
General Timeout Error in my case was due to the fact that the long sql
statement was taking longer than 30 seconds to complete and the
CommandTimeout property of my SqlCommand was not set to accomodate it.
Making CommandTimeout big enough to accomdate the sql statement removes the
general timeout error.

So then my confusion is this. When it takes longer for the SqlCommand to
complete the sql statement than the CommandTimeout, which was the case in
mine, it threw the general timeout error, but why? Shouldn't it throw the
timeout expired error? I don't see why the error that got generated was
General Timeout Error instead of the Timeout Expired error.
 
Back
Top