Re: Script Time Out Issue



There are two different DB accesses going on. One is now a onetime call at
the front of the routine to SQL which uses Provider=sqloledb;" "Network
Library=DBMSSOCN;" and I then use GetRows to put the rs into an array and
then close the rs and set to nothing.

The other is an ODBC Conn using a DSN to the API of an LMS application that
has tables in the same DB.
This is used twice in each iteration of the loop.

I am suspicious of the ODBC - I checked on the ODBC timeout and it relates
to the Connection Pool. Any closed Conn is put into the Pool so that if a
subsequent Conn.Open cmd has the exact matching parms it will be used. It
indeed has a default of 60s before the Conn is removed from the Pool.

Currently I have forced the loop to alternate between two rows of data to
remove any possible data issues.

On repeated runs wscript goes to 0%CPU after either 60 or 75 seconds and
then produces an error message that it failed to perform one of the LMS API
functions that connect with ODBC.

At one point I had several runs where wscript went to 0 and then after a few
seconds recovered and the script ran to completion . As if a delayed ODBC
operation sometimes crept back within the timeout.

I will try and see if changing the Conn. CommandTimeOut does anything

Will advise

Thanks again



"Marco Shaw [MVP]" <marco.shaw@xxxxxxxxxxxxxxxxxx> wrote in message
news:eINp0OVoIHA.3376@xxxxxxxxxxxxxxxxxxxxxxx
Dash wrote:
Hi All
I have been fighting this one for several days and will much appreciate
any pointers.

The issue concerns a vbscript running on Windows Server 2k3 SP2. The
purpose of the script is to read from a SQL Server DB on the same server,
process the data and and write it back to other tables in the DB.
There is a total of about 4k rows to process.

The issue is that the script fails after 75 seconds with no immediate
error message. In Task Manager the CPU activity of wscript.exe which was
bouncing between 10 and 15 % drops to 0 at the 75 second point, with no
measurable variation from run to run.

After another 60 seconds I get a WSH Script Error message with a VB
script Run Time error.

1. I have shuffled the DB so I don't think it is data related.
2. I have made multiple code changes to change the order of tyhe
operations with no effect
3. wscript.timeout set for either 0 or 600 has no effect
4. IIS script timeout is set for 600s and I would not think was involved
anyway.

I supect there is a timeout I am missing - I didn't find out about the
wscript.timeout until long into the trouble shooting and fully expected
that might have been the culprit - but it isn't.

Any suggestions will be much appreciated.

I'm assuming you are using ODBC to access SQL. I searched quickly, and it
seems that 60 seconds is a default timeout. I wasn't able to quickly find
how to change this, but this might give you something to look into.

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com


.