Skip to Content.
Sympa Menu

freetds - Re: freetds JDBC + Stack Overflow Error

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Steve Sherwood" <stephens AT cabletron.com>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: freetds JDBC + Stack Overflow Error
  • Date: Fri, 29 Oct 1999 08:18:57 +0100


On Thu, 28 Oct 1999 11:44:27 -0400 (EDT), Bob Kline wrote:

>On Thu, 28 Oct 1999, Steve Sherwood wrote:
>
>> Using the lastest version of the freetds JDBC drivers.
>>
>> Bit complex this. Using MSSQL7, I have a stored procedure like
>> the following :-
>>
>> BEGIN TRANSACTION
>> DECLARE @LOWER int, @UPPER int, @COUNT
>>
>> SET @COUNT=0
>> WHILE (@COUNT < 255)
>> BEGIN
>> INSERT INTO subnet VALUES (@COUNT, <data>)
>> SET @COUNT = @COUNT+1
>> END
>> COMMIT TRANSACTION
>>
>> Then in my Java code I call this
>> Statement s = connection.createStatement();
>> s.execute("EXEC StoredProc");
>> s.close();
>>
>> I get the exception :-
>>
>> [28/10/1999 16:24:34:609 GMT+01:00] java.lang.StackOverflowError
>> at com.internetcds.jdbc.tds.TdsComm.skip(Compiled Code)
>> at com.internetcds.jdbc.tds.Tds.processDoneInProc(Compiled Code)
>> at com.internetcds.jdbc.tds.Tds.processSubPacket(Compiled Code)
>> at com.internetcds.jdbc.tds.Tds.processSubPacket(Compiled Code)
>> at com.internetcds.jdbc.tds.Tds.processDoneInProc(Compiled Code)
>> at com.internetcds.jdbc.tds.Tds.processSubPacket(Compiled Code)
>> at com.internetcds.jdbc.tds.Tds.processSubPacket(Compiled Code)
>> ...etc (lots of lines removed - Possibly 255 sets)
>>
>> I can decrease the count to about 124 and then the exception
>> goes away. I'm assuming it's something to do with multiple
>> rowsets, but I can't find a way around it.
>>
>> Anyone help ?
>
>I don't understand why any result sets would be produced by the
>procedure at all if the only SQL queries are INSERT statements. So
it's
>hard to see how a change which should be completely transparent to the
>client (that's why we use servers, right?) could have such an effect.

If I EXEC the Stored Procedure from within the SQL Query tool,
I get the following results...

(1 row(s) affected)
(1 row(s) affected)
(1 row(s) affected)
[255 times]

I wonder if there is a way of disabling this "feature" of
SQL7? Or is what I'm doing in the stored procedure bad
practice? I couldn't find any other way of doing it.

In the short term I've coded the loop in Java, but this
is very slow and create lots of traffic.

Steve


---
Steve Sherwood - stephens AT ctron.com - (01635) 810517
O---------------------------------+-----------------------O
| Just like Pariah I have no name | Never feed your cat |
| Living in a blaze of obscurity | anything that clashes |
| Need courage to survive the day | with the carpet... |
O---------------------------------+-----------------------O
(A)bort (R)etry (I)nfluence with large hammer






Archive powered by MHonArc 2.6.24.

Top of Page