473,772 Members | 2,448 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 2274
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
8812
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 update, and then an insert, in that order. I am doing this for speed, since my program can't afford to wait for the answer from the first to complete before making the request for the second. For some reason this method has started giving the...
2
1646
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 strategy: 1) Create a thread for each connection and use blocking receives, 2) Use asynchronous receives (BeginReceive/EndReceive) In both cases, I will also be sending data on the socket from the main thread.
7
2028
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 2000. They are continuing to work on the issue, but it seems as if our progress is grinding to a halt. I asked this question on the newsgroups before going to MS but figured I'd give it another shot now that I have more information. The problem...
3
3993
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 idle time by the client as it waits for a query to execute and return a dataset. As a test, I initially wrote two versions: ' // Sequential & Synchronous Dim webobj As com.mycompany.webobject Dim ds1 As System.Data.DataSet Dim ds2 As...
0
960
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 aborted" every other time I call the service. As well, when the output window displays the error, all the other messages showing which assemblies are being loaded don't appear (but the service seems to run fine). When I uncomment calls to a...
0
1520
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 sql statements. My question is this: Why does SQL generate a General Network Error instead of the Timeout Expired Error? When I run my program multiple times, there are cases where I'd get the Timeout Expired Error ("The timeout period elapsed...
2
1513
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 primary experience is developing applications using VB or DotNet. I have some sql skills but they are limited. In a previous company our concept on SQL was that it was used for very simple work, (i.e. insert, update, delete, select, etc). The...
1
3043
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 the web service methods. What I like about the asynchronous calls that they use events. So when I call the web service operation is finished is fires the event. So all my objects that I'm using in my client application just subscribe to whatever...
7
7691
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() on the request object on another thread, GetResponse() returns with an exception as expected. However, when I monitor the network traffic, it does not seem to stop, but to continue to be active and to upload the file. The network is active even...
0
10103
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9911
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7460
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6713
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.