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.
Memory Overrun Leak executing a Stored Procedure
-
- Posts: 2
- Joined: Fri 04 Dec 2009 05:17
-
- Posts: 2
- Joined: Fri 04 Dec 2009 05:17
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;
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;