Subject | Blob problems (IBO and FB 1.5 RC8 -RC9 possible bug) |
---|---|
Author | mp527 |
Post date | 2004-02-18T05:59:37Z |
This may be a bug in IBO or FB 1.5 I am not sure,or it could be my
code, but basicly using the code below (stored proc and IBO client
code) the FB server process will rise and rise and rise until the
servers memory is exhausted.
I originally was using a blobstream, then changed it to use assign
just to see if it made any difference and it did not.
Anyone see anything wrong with my code? or any Ideas?
CREATE PROCEDURE ADD_NEW_OFFLINE_MSG (
MSG_BLOB BLOB SUB_TYPE 0 SEGMENT SIZE 4096)
RETURNS (
MSG_ID INTEGER)
AS
begin
MSG_ID = GEN_ID(GEN_OFFLINE_MSG_BLOBS_ID,1);
INSERT INTO OFFLINE_MSG_BLOBS
(MSG_ID,MSG_BLOB)
VALUES
(:MSG_ID,:MSG_BLOB) ;
suspend;
end
Then on the client with IBobjects (latest version):
function Tclientthread.add_new_offline_msg(themsg: tmemorystream):
integer;
begin
result:=0;
themsg.Position:=0;
with db_query do
begin
ib_transaction.StartTransaction;
try
sql.clear;
sql.Add('select * from ADD_NEW_OFFLINE_MSG
(:THEMSG)');
if not Prepared then Prepare;
themsg.Position:=0;
paramByName('THEMSG').Assign(themsg);
first;
result:=fieldbyname('MSG_ID').asinteger;
IB_Transaction.Commit;
close;
except
on e:exception do
begin
if IB_Transaction.Started then
IB_Transaction.Rollback;
writeerrorlog(e.message+'
(add_new_offline_msg)');
raise;
end;
end;
end;
end;
code, but basicly using the code below (stored proc and IBO client
code) the FB server process will rise and rise and rise until the
servers memory is exhausted.
I originally was using a blobstream, then changed it to use assign
just to see if it made any difference and it did not.
Anyone see anything wrong with my code? or any Ideas?
CREATE PROCEDURE ADD_NEW_OFFLINE_MSG (
MSG_BLOB BLOB SUB_TYPE 0 SEGMENT SIZE 4096)
RETURNS (
MSG_ID INTEGER)
AS
begin
MSG_ID = GEN_ID(GEN_OFFLINE_MSG_BLOBS_ID,1);
INSERT INTO OFFLINE_MSG_BLOBS
(MSG_ID,MSG_BLOB)
VALUES
(:MSG_ID,:MSG_BLOB) ;
suspend;
end
Then on the client with IBobjects (latest version):
function Tclientthread.add_new_offline_msg(themsg: tmemorystream):
integer;
begin
result:=0;
themsg.Position:=0;
with db_query do
begin
ib_transaction.StartTransaction;
try
sql.clear;
sql.Add('select * from ADD_NEW_OFFLINE_MSG
(:THEMSG)');
if not Prepared then Prepare;
themsg.Position:=0;
paramByName('THEMSG').Assign(themsg);
first;
result:=fieldbyname('MSG_ID').asinteger;
IB_Transaction.Commit;
close;
except
on e:exception do
begin
if IB_Transaction.Started then
IB_Transaction.Rollback;
writeerrorlog(e.message+'
(add_new_offline_msg)');
raise;
end;
end;
end;
end;