473,396 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ADO client disconnects after running a long query

I am having a problem executing long running queries from an ASP application
which connects to SQL Server 2000. Basically, I have batches of queries that
are run using ADO in a loop written in VBScript. This works pretty well
until the execution time of a single query starts to exceed some threshold,
which I am trying to narrow down. I can typically run 2 - 10 queries in a
loop, with the run time being anywhere from under a minute to an hour or
more. Now that this application is being subjected to run against some large
databases (25 - 40G), I'm having problems getting the application to
continue beyond the first query if it takes a while to run.

I used SQL Profiler to try to diagnose what was going on. I can see the
query executes to completion, but immediately after completing I can see an
"Audit Logout" message, which apparently means that the client has
disconnected. The query durations vary from 45 or 50 minutes to up to over
90 minutes. I have the ADO connection and query timeouts set to very large
values, e.g. 1000 minutes, so I can't think its that. My guess is that there
is some IIS setting or timeout that I am running up against and the
connection to SQL Server is just dropped for some reason.

The configuration is

NT 4.0 SP6
SQL Server 2000 SP3
IIS 4.0
Internet Explorer 5.5

I'm only running into this problem on the very largest databases we run
against. The vast majority continue to function properly, but this is going
to happen more often as time goes on the databases continue to grow in size.

Any advice is appreciated,

-Gary


Jul 20 '05 #1
4 3335
Gary wrote:
I am having a problem executing long running queries from an ASP
application which connects to SQL Server 2000. Basically, I have
batches of queries that are run using ADO in a loop written in
VBScript. This works pretty well until the execution time of a single
query starts to exceed some threshold, which I am trying to narrow
down. I can typically run 2 - 10 queries in a loop, with the run time
being anywhere from under a minute to an hour or more. Now that this
application is being subjected to run against some large databases
(25 - 40G), I'm having problems getting the application to continue
beyond the first query if it takes a while to run.

I used SQL Profiler to try to diagnose what was going on. I can see
the query executes to completion, but immediately after completing I
can see an "Audit Logout" message, which apparently means that the
client has disconnected. The query durations vary from 45 or 50
minutes to up to over 90 minutes.
!??!?
Don't use ASP for this. Why tie up a thread on your web server for that
long??

I'm willing to be that this entire task could be done within a scheduled
stored procedure.

I have the ADO connection and query
timeouts set to very large values, e.g. 1000 minutes, so I can't
think its that. My guess is that there is some IIS setting or timeout


Probably ScriptTimeout
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 20 '05 #2
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
Don't use ASP for this. Why tie up a thread on your web server for that
long??

I have no choice at the moment. I realize it's not an optimal solution. Also
there are rarely more than a couple requests at a time going on.
I'm willing to be that this entire task could be done within a scheduled
stored procedure.
Some of it is scheduled, but it's designed to work on-demand as well.
I have the ADO connection and query
timeouts set to very large values, e.g. 1000 minutes, so I can't
think its that. My guess is that there is some IIS setting or timeout


Probably ScriptTimeout


This is already set to a really large value. (way more than an hour) But
thanks for the suggestions.

-Gary



Jul 20 '05 #3
"Gary" wrote:
My guess is that there is some IIS setting or
timeout that I am running up against and the
connection to SQL Server is just dropped for
some reason.


Gary,

If your ASP times out, you definitely want the connection to stop since
there's no reason for it run anymore :)

In any event, there is an IIS timeout setting, but you can change it in your
script:

<%
Server.ScriptTimeout = Number_Of_Seconds
%>

Craig
Jul 20 '05 #4
Gary wrote:
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
Don't use ASP for this. Why tie up a thread on your web server for
that long??


I have no choice at the moment. I realize it's not an optimal
solution. Also there are rarely more than a couple requests at a time
going on.
I'm willing to be that this entire task could be done within a
scheduled stored procedure.


Some of it is scheduled, but it's designed to work on-demand as well.


You can kick off a scheduled job that runs a stored procedure using
sp_start_job. To pass parameter values to the procedure, you can insert them
into a control table where they can be read by the stored procedure.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Boris Nikolaevich | last post by:
This is backwards of what I usually want--normally if you have a long-running ASP script, it's a good idea to check to see whether the client is still connected so you can cancel execution. ...
0
by: Gary | last post by:
I am having a problem executing long running queries from an ASP application which connects to SQL Server 2000. Basically, I have batches of queries that are run using ADO in a loop written in...
5
by: Tyler Hudson | last post by:
After reading Erland Sommarskog's most enlightening articles on SQL Server 2000's error handling capabilities (http://www.sommarskog.se/error-handling-I.html and...
7
by: Sidd | last post by:
Hi, I tried finding and example of multithreaded client-serve program in python. Can any one please tell me how to write a multithreaded client-server programn in python such that 1.It can handle...
0
by: Kapil Shah | last post by:
Hello Everybody, I have created a console multithreaded client server application where many client connects to the server. I have created a timer in the server which asks the client every 30...
2
by: Johan | last post by:
We have run into problems calling a web service from a client running .NET framework 2.0. The problem is that the first call to the web service, after the client has been started, takes very long...
4
by: =?Utf-8?B?SGl3ag==?= | last post by:
I recently upgraded my application from VB6, and was using the Winsock control. In VB2005 I am using the TcpListener Class and have managed to get it working, except for one thing: Is there a...
3
by: jlgeris | last post by:
I have a fairly simple client/server structure using System.Net.Sockets, where the server only sends data to a collection of clients, and the clients only receive data, so, the data flow is...
7
by: Vishal | last post by:
Hi, I am writing a CGI to serve files to the caller. I was wondering if there is any way to tell in my CGI if the client browser is still connected. If it is not, i want to execute some special...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.