Can't retrieve TStreams bigger than around 260.000 bytes from a Datasnap Server

前端 未结 6 528
盖世英雄少女心
盖世英雄少女心 2020-12-11 06:05

I have a Delphi 10.1 Berlin Datasnap Server, that can\'t return Data packets (through a TStream) bigger than around 260.000 bytes.

I have programmed it following the

6条回答
  •  清歌不尽
    2020-12-11 06:33

    The problem seems to be neither the TStream class nor the underlying DataSnap communication infrastructure, but that TFDStoredProc component creates a return parameter of type ftBlob. In first place, change the output parameter from ftBlob to ftStream. Then, change GetTables procedure to:

    procedure  TClientForm.GetTables;
    var
      LStringStream: TStream;
    begin
      spStreamGet.ExecProc;
      LStringStream := spStreamGet.Params[0].AsStream;
      LStringStream.Position := 0;
      DataModuleFDClient.FDSchemaAdapter.LoadFromStream(LStringStream, 
      TFDStorageFormat.sfBinary);
    end;
    

提交回复
热议问题