SQL Server 7.0 doing infinite loop on a web app.

SQL Server 7.0 doing infinite loop on a web app.

Post by rich » Thu, 31 Jan 2002 06:13:43



We've got 7.0 running on NT 4.0 and we're running into a problem where it
appears the users are hitting a web page that submits a query to the db and
then get impatient - so they hit the stop button on the browser.  We're
using the MS jdbc driver to hit SQL Server from Java Servlets and all of
the web processes seem to handle this fairly cleanly, but on the db machine
we zoom from using 3% of the cpus (dual cpu box) to using 50% or better.  
Needless to say everything slows quite a bit at that point.  Interestingly
enough there is no disk activity going on so it's not as if SQL Server is
working like mad through some series of large tables.  Anyone else heard of
anything like this?  If so does moving to SQL 2000 and applying the service
packs help?  Came across a few articles in the knowledge base that showwed
sql serevr going into an ifinite loop for other conditions and in several
of the cases the answer was to get to SQL 2000 with sp 2, but I'd like to
get some comments from anyone in the field that has faced this before we go
spend the money.

Thanks.

Rich Mycroft

 
 
 

SQL Server 7.0 doing infinite loop on a web app.

Post by rich » Thu, 31 Jan 2002 11:54:08


OK. solved this.  Had to do with the way we were using a series of temp
tables and at one point doing an insert into one of the temp tables while
doing a NOT IN subselect to try to make sure we weren't inserting
duplicates.  Evidently the system decided to re-build the elements of the
NOT IN after each row was inserted from the outer SQL resulting in a *
little cpu sucker.  Used another temp table to permit me to delete matches
from the first temp table out of the second one followed by doing an insert
into the first thereby dropping the NOT IN bit. Works just fine.

> We've got 7.0 running on NT 4.0 and we're running into a problem where it
> appears the users are hitting a web page that submits a query to the db
> and
> then get impatient - so they hit the stop button on the browser.  We're
> using the MS jdbc driver to hit SQL Server from Java Servlets and all of
> the web processes seem to handle this fairly cleanly, but on the db
> machine we zoom from using 3% of the cpus (dual cpu box) to using 50% or
> better.
> Needless to say everything slows quite a bit at that point.  Interestingly
> enough there is no disk activity going on so it's not as if SQL Server is
> working like mad through some series of large tables.  Anyone else heard
> of
> anything like this?  If so does moving to SQL 2000 and applying the
> service
> packs help?  Came across a few articles in the knowledge base that showwed
> sql serevr going into an ifinite loop for other conditions and in several
> of the cases the answer was to get to SQL 2000 with sp 2, but I'd like to
> get some comments from anyone in the field that has faced this before we
> go spend the money.

> Thanks.

> Rich Mycroft



 
 
 

SQL Server 7.0 doing infinite loop on a web app.

Post by Jeff Kis » Thu, 31 Jan 2002 22:43:55


Hey, Rich,

How did you come to this conclusion (what debugging steps did you
take)? How did you come to notice this?

Thanks
Jeff



>OK. solved this.  Had to do with the way we were using a series of temp
>tables and at one point doing an insert into one of the temp tables while
>doing a NOT IN subselect to try to make sure we weren't inserting
>duplicates.  Evidently the system decided to re-build the elements of the
>NOT IN after each row was inserted from the outer SQL resulting in a *
>little cpu sucker.  Used another temp table to permit me to delete matches
>from the first temp table out of the second one followed by doing an insert
>into the first thereby dropping the NOT IN bit. Works just fine.


>> We've got 7.0 running on NT 4.0 and we're running into a problem where it
>> appears the users are hitting a web page that submits a query to the db
>> and
>> then get impatient - so they hit the stop button on the browser.  We're
>> using the MS jdbc driver to hit SQL Server from Java Servlets and all of
>> the web processes seem to handle this fairly cleanly, but on the db
>> machine we zoom from using 3% of the cpus (dual cpu box) to using 50% or
>> better.
>> Needless to say everything slows quite a bit at that point.  Interestingly
>> enough there is no disk activity going on so it's not as if SQL Server is
>> working like mad through some series of large tables.  Anyone else heard
>> of
>> anything like this?  If so does moving to SQL 2000 and applying the
>> service
>> packs help?  Came across a few articles in the knowledge base that showwed
>> sql serevr going into an ifinite loop for other conditions and in several
>> of the cases the answer was to get to SQL 2000 with sp 2, but I'd like to
>> get some comments from anyone in the field that has faced this before we
>> go spend the money.

>> Thanks.

>> Rich Mycroft


 
 
 

1. Infinite cursor looping problem in SQL server 6.5 service pack 5a]

Hi Folks,

We have recently  installed SQL server 6.5 & Service Pack 5a.  
The client is in 'C'  which  connects to  the SQL server database
through ODBC calls.

We encountered  dynamic cursor going in to infinite loop with service
pack 5a. This is a known  bug  in Service Pack 5a & the fix given is to
make the cursor INSENSITIVE or use the latest 440 build.

We  don't have cursors created  at the server side.  From the client  we
tried setting  the  the cursor  type to SQL_CURSOR_KEYSET_DRIVEN  
through
nResult =
SQLSetStmtOption(reqBatchStatement,SQL_CURSOR_TYPE,
SQL_CURSOR_KEYSET_DRIVEN);
The  infinite looping problem gets fixed with the above statement but
client gets hung when 3-4 clients make large transactions.

Can anyone help me, how to make the cursor INSENSITIVE through
 ODBC call?
And also where can I get Service Pack 5a ,  440  build.

Thanks in advance for any help.
Ragu

2. Scheduling DTS packages

3. Infinite cursor looping problem in SQL server 6.5 service pack 5a

4. Foxpro 6 -- textbox question

5. Infinite cursor looping problem in SQL server 6.5 service pack 5a]

6. Theory question on collecting stats

7. Infinite cursor looping problem in SQL server 6.5 service pack 5a

8. Database Dump fails

9. Infinite cursor looping problem in SQL server 6.5 service pack 5a]

10. Infinite loops possible in PL/SQL?

11. Infinite Loop

12. Apparent Infinite loop even on SP3

13. Infinite Loop when trying to Update a cursor using WHERE CURRENT OF