Page 1 of 1

Memory Overrun Leak executing a Stored Procedure

Posted: Fri 04 Dec 2009 06:07
by lucatralli
EurekaLog raise the "Overrun Memory Leak" when I free a TUniStoredProc object.

I use Firebird and the example it's very easy:

orSP := TUniStoredProc.Create(Self);
orSP.StoredProcName := 'SP_GET_NEWOID';
orSP.Connection := DataModuleMain.UniConnectionProf;
orSP.PrepareSQL(False);
orSP.ParamByName('SIGLATABELLA').AsString := 'SQLR';
orSP.Execute;
ShowMessage(orSP.ParamByName('NEW_OID').AsString);
orSP.Close;
FreeAndNil(orSP);

The result of the Stored Procedure is ok but the FreeAndNill cause the problem.

Posted: Fri 04 Dec 2009 12:56
by Plash
Please provide the code of your stored procedure.

Posted: Wed 09 Dec 2009 06:17
by lucatralli
The SP is a little bit complex and calls differents SP but I realized a simple version that you can use to reproduce the problem.

Anyway the problem is connected with the "UseUnicode" = True
The Database has many fields in unicode but not all.
This procedure returns a value not unicode.
If I remove the UseUnicode = True in the connection all works well.

/* Stored procedure you can use */

SET TERM ^ ;

create or alter procedure SP_GET_NEWOID (
SIGLATABELLA varchar(4) character set NONE)
returns (
NEW_OID char(24) character set NONE)
as
BEGIN
NEW_OID = 'A00001' || '-' || SIGLATABELLA || '0000000000001';
SUSPEND;
END^

SET TERM ; ^

GRANT EXECUTE ON PROCEDURE SP_GET_NEWOID TO SYSDBA;

Posted: Wed 09 Dec 2009 09:40
by Plash
We have fixed this problem. The fix will be included in the next build of UniDAC.