473,508 Members | 4,779 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

General network error when making asynchronous calls to long sql

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
3 2254
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8766
by: pgsql | last post by:
I am doing asynchronous sql calls using the postgres C library. After doing two PQsendQuery() calls, I get the "another command is already in progress" error. The two calls I am doing are an...
2
1624
by: Bruce Vander Werf | last post by:
I am developing a network client application (using the Socket class) that will need to make simultaneous TCP connections to many (100 or more) servers. In this case, which would be a better...
7
2013
by: Joe Ross | last post by:
I've been working with Microsoft support for over 3 weeks now on an intermittent General Network Error we're seeing in our production environment between our ASP.NET application and SQL Server...
3
3977
by: usenetaccount | last post by:
In a newly created test app, to maximize client performance I tried to make two SOAP method calls in tandem (the soap methods execute some specified query), as each call includes a large amount of...
0
945
by: Brad Wood | last post by:
Running a web service on 1.1. Even though I don't recieve any errors in the output of the service, I see a ThreadAbortException in the ide output window when it's debugging, "Thread was being...
0
1496
by: Yong | last post by:
I'm not getting any reply to my previous thread so I'm stating a new one. I get a General Network Error due to my SqlCommand object not having a big enough CommandTimeout to complete very long...
2
1498
by: Doug | last post by:
Hi, I wanted to start a general discussion more for getting some thoughts on what other people think/practice out there just to see how far (if at all) I'm off base on my own thoughts. My...
1
3022
by: jan.loucka | last post by:
I'm developing WinForms application in .NET 2.0 that talks to web service. The automatically generated proxy (reference class) has got methods for both synchronous and asynchronous invocations of...
7
7652
by: Marc Bartsch | last post by:
Hi, I have a background worker in my C# app that makes a synchronous HttpWebRequest.GetResponse() call. The idea is to POST a file to a server on the internet. When I call HttpWebRequest.Abort()...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.