Subject Re: [IBO] Integer Overflow Exception - TIB_StoredProc
Author G. Nau
it is indeed an integer overflow and not a GDSCode.
The overflow happens in the IB_storedproc.execute method.
My example is just a very basic one to test and replicate the
Variable 'i' in my example is just a counter written into the console
screen "write (i,' ')" as quick and dirty debugging.
As my test stored procedure is always returning "1" it for sure, that
the stored proc itself does not contain any problems.
I checked further and found the place the overflow is happening:
file ib_components.pas, line 25781 in procedure
TIB_Dataset.SysClose (in my version 4.5Ai of IBO)
Inc( FCursorGen ); <<<<-- here
FCursorGen := 0;
FcursorGen is defined as word and overflowing at a count of 65535
(which happens approx. after calling TIB_Storedproc.execute 32768
Is this a limitation within FB or do I have to do some cleanup work
after a call to TIB_storedproc.execute to keep the value of the
FCursorGen low?

To give it a test I redefined the FcursorGen from Word to LongWord
and can call TIB_storedproc now without any limit.
But this doesn't sound like a correct solution to me.
What has to be done to keep the FCursorGen counter at low


Am 7 Sep 2005 um 11:03 hat Helen Borrie geschrieben:

> At 09:17 PM 6/09/2005 +0200, you wrote:
> >I observe an Integer Overflow Exception after 32769 calls to the
> >same stored procedure with IBObjects.
> >procedure TTEST4.Button1Click(Sender: TObject);
> >VAR I: integer;
> >ref:integer;
> >begin
> > allocconsole;
> > I:=0;
> > repeat
> > INC(I);
> > Write(I,' ');
> > IB_StoredProc1.Execute;
> > until i=100000;
> >end;
> >
> >My configuration: Delphi7 Prof, Firebird 1.5, IBO V4.5.Ai
> Are you also getting GDSCode 335544663, "Too many executions of the same
> request"? This used to occur after 1024 executions but in either Fb 1 or
> Fb 1.5 it was increased to a SMALLINT (max. 32769).
> But if the only message you are seeing is "Integer Overflow Exception"
> without an ISC exception then the error is on the Delphi side somewhere
> (and I can't throw any light on it).
> Pardon my ignorance, but I don't see what that Write(I, ' ') statement is
> meant to do and I can't see your ref variable doing anything. Are there
> some pieces missing from what you posted here?
> Helen

[Non-text portions of this message have been removed]