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

General network error when making asynchronous calls to long sql

P: n/a
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.
Feb 6 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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?
"Vadym Stetsyak" wrote:
Hello, Yong!

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

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

If you use SqlCommand, what value has CommandTimeout property? Did you try to increase it?

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot

Feb 8 '06 #2

P: n/a
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
Feb 8 '06 #3

P: n/a
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.

"Vadym Stetsyak" wrote:
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

Feb 8 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.