VadimMest

Forum Replies Created

Viewing 31 reply threads
  • Author
    Posts
    • #57469
      VadimMest
      Participant

      This may be an issue in Swaggers scripts.

    • #57468
      VadimMest
      Participant

      I tried this url

      http://127.0.0.1:888/myserver/api/index.html?url=/myserver/api

      /myserver/api = /myserver/api

      I didn’t change your server description

      [kbmMW_Rest(‘path:/myserver’)]

      [kbmMW_Rest(‘method:get, path: “api”, responseMimeType:”application/x-yaml”‘)]
      function OpenAPI:string;

      The OpenAPI function is not called and Server shows Swagger Pet Store

      Thanks
      Vadim

    • #57440
      VadimMest
      Participant

      Yes.
      I installed Swager UI. Server doesn’t call a function OpenAi (?url=/myserver/api)

    • #56113
      VadimMest
      Participant

      The version control system needs to refresh handles for new versions of files.

      The operator runs the program (a client for version control). This program checks new files on the version control system (main application exe, the FastReport templates), downloads them on the client’s computer and runs the main application. I need to refresh files on the cache for a new one.

      I agree with the time out garbage collection isn’t convenient for renewing a cache of handles but how can I renew it?

       

    • #56070
      VadimMest
      Participant

      But in the real life the client misses files and my version control system doesn’t work properly.

    • #56069
      VadimMest
      Participant

      All Integer fields values don’t restored from xml

    • #56068
      VadimMest
      Participant
    • #56050
      VadimMest
      Participant

      Maybe the problem is in the other parts but it exists. I insist

      When I’ve changed the version to  5.15.0 I’ve got the problem with kbmMemTable savetoxml + loadfromxml. If the Integer field has zero value in the source dataset when the target dataset’s field will contain the null value after the record was loaded from xml.  It was a tricky problem for me. I traced it in the debugger and I found what ANode.DataLength = 0 for this node and It was the problem.

      procedure TkbmMWCustomXMLStreamFormat.LoadData(ADataset:TkbmCustomMemTable);
      procedure PopulateFieldFromNode(const AField:TField; const ANode:TkbmMWDOMXMLNode);
      var
      i:TkbmNativeInt;
      ms:TkbmMWMemoryStream;
      s:string;
      {$IFNDEF FMX}
      {$IFNDEF LINUX}
      jpeg:TJPEGImage;
      png:TPngImage;
      bmp:TBitmap;
      {$ENDIF}
      {$ENDIF}
      begin
      if (ANode.IsNil) or
      ((ANode.DataLength<=0) and (AField.DataType in [ftBoolean,ftLargeInt,
      {$IFDEF KBMMW_SUPPORTFTSHORTINT}

      I can send test project to you.

      Thanks

      Vadim Mesheryakov

      • This reply was modified 4 years, 3 months ago by VadimMest.
    • #56023
      VadimMest
      Participant

      No, I am not right.

      If I add this block the service freezes during sending files

      The problem hides in another place.  I can see the same error inside the function CreateNewFileHandle.  AReferences.Items deleted in some parallel thread and this code show error

      if AToken<0 then
      begin
      // Generate unique random token number.
      // Its randomized to minimize the ability to guess a token my
      // malicious clients.
      repeat
      j:=trunc(Random*$0FFFFFFE)+1;
      b:=true;
      for i:=0 to AReferences.Count-1 do
      if AReferences.Items[i].FToken=j then
      begin
      b:=false;
      break;
      end;
      until b;
      AToken:=j;
      end;

      How can I fix it?

       

       

    • #56022
      VadimMest
      Participant

      Dear Kim

      I want see only errors in debug file. I set kbmMWDebugLevel := mwdlError. But the dubug file contains all events and data, because all comparsion are like this

      procedure kbmMWDebugDumpStream(ALevel:TkbmMWDebugLevel; AType:TkbmMWDebugType; AWhere:TkbmMWDebugDump; AOrigin:string; AMessage:string; AStream:TStream);
      {$IFNDEF KBMMW_NODEBUG}
      var
      pBuf:PByte;
      opos:TkbmNativeInt;
      begin
      if kbmMWDebugLevel<ALevel then exit;

       

      procedure kbmMWDebugDumpTransportStream(ALevel:TkbmMWDebugLevel; AWhere:TkbmMWDebugDump; AOrigin:string; AMessage:string; const AStream:IkbmMWCustomTransportStream);
      var
      s:string;
      i:integer;
      const
      CR=#13#10;
      begin
      if kbmMWDebugLevel<ALevel then exit;
      if not (mwdtTransport in kbmMWDebugTypes) then exit;

      How can I set limit for debug info detail?

    • #56021
      VadimMest
      Participant

      The problem seems in function TkbmMWFilePool.Access(AFilePath:string; const AMode:TkbmMWFileAccessMode; var AToken:integer; var AHandle:THandle; const ADenyWrite:boolean = true):TkbmMWFileReference;

      the second call CreateNewFileHandle doesn’t contain ” lst:=FFileReferences.BeginWrite + FFileReferences.EndWrite”

      // No token provided, add access and return new token.
      AHandle:=CreateNewFileHandle(lst,Result,AFilePath,AMode,AToken);

      Are I right?

       

    • #55978
      VadimMest
      Participant

      >Error reading kbmMWCustomService.PixelsPerInch: Property PixelsPerInch does not exists (SERVER)
      It seems like dfm  file contains property PixelsPerInch but version Delphi what used to build server doesn’t know about this propertiy. The form or the datamodule was opened and was saved in other version Delphi or don’t prepared for your version

      Try to  open kbmmw\source\d104\*.dfm  and remove absent properties. Check library path for versions of dfm

      Best Regards
      Vadim Mescheryakov

    • #55888
      VadimMest
      Participant

      Few interesting facts about performance

      I run tests for 100 000 records. I know it’s a ridiculous amount of records, but my laptop very fast and I need to see how it affects my client’s workplaces.

      The pair  TKbmMemtable + TVirtualQuery works very slowly, very.
      The pairs of TKbmMemtable + TkbmMemSQL  and  TVirtualTable  + TVirtualQuery  work fast and about similar
      The BDE pair ( TTable + TQuery) is the fastest on my laptop with nwme SSD, on the old hard disk is slower but it isn’t dramatic.  BDE is the best 🙂

    • #55887
      VadimMest
      Participant

      I found two solutions:

      1. TKbmMemSQL (only for creating a table)   +  TKbmMemtable + TVirtualQuery (from DevArt UNIDAC)  works properly.
      2. Changing ‘Create table’ from SQL Statement to AddField + TVirtualTable  + TVirtualQuery also works properly and faster than the first solution
    • #55886
      VadimMest
      Participant

      Thanks, I’ve understood:

      I can use: One knmMemTable + Few KbmMemSQL with only modify SQL Statements

      I have a table with documents rows in my application (TTable).  User changes these rows by using an interface (it is my code in application)  and my customers have a huge quantity of different external scripts (Fast Script Interpreter) that can change data in this table (make discounts or check free quantity in a stock uses for this purpose TQuery).  Therefore, I am seeking the ability to have a table and few queries that can change data.

       

      The First question: How do I make this code below easy?

      FSQL.ExecSQL(‘create table t1 (id Integer, name char(50))’);
      FSQL.ExecSQL(‘select * from t1’);
      kbmMemTable1.LoadFromDataSet(FSQL, [mtcpoStructure, mtcpoProperties]);

      The statement ‘create table t1’ creates the table in memory but I didn’t figure out how can I use this table directly

      The Second question: In my project, I often use TQuery for changing selected rows as Dataset (Edit Post)

      But this code also doesn’t change original data in the original table:

      FSQL1.ExecSQL(‘select * from t1’);
      FSQL1.First;
      while not FSQL1.Eof do
      begin
      FSQL1.Edit;
      FSQL1.FieldByName(‘Name’).AsString := ‘Name Edited’;
      FSQL1.Post;
      FSQL1.Next;
      end;

      Thanks,
      Vadim Mescheryakov

       

       

    • #55880
      VadimMest
      Participant

      procedure TForm4.Button1Click(Sender: TObject);
      begin
      FSQL.ExecSQL(‘create table t1 (id Integer, name char(50))’);
      FSQL.ExecSQL(‘select * from t1’);

      kbmMemTable1.LoadFromDataSet(FSQL, [mtcpoStructure, mtcpoProperties]);

      kbmMemTable1.AppendRecord([1, ‘Name 1’]);
      kbmMemTable1.AppendRecord([2, ‘Name 2’]);

      FSQL.Tables.Clear;

      FSQL.Tables.Add(‘t1’, kbmMemTable1);

      FSQL1.Tables.Add(‘t1’, kbmMemTable1);

      kbmMemTable1.AppendRecord([11, ‘Name 11’]);
      kbmMemTable1.AppendRecord([12, ‘Name 12’]);

      FSQL1.ExecSQL(‘update t1 set id = id + 100’);
      FSQL1.ExecSQL(‘select * from t1’);

      FSQL1.AppendRecord([23, ‘Name 23’]);
      FSQL1.AppendRecord([23, ‘Name 23’]);

      kbmMemTable1.AppendRecord([41, ‘Name 41’]);
      kbmMemTable1.AppendRecord([42, ‘Name 42’]);
      kbmMemTable1.Refresh;
      FSQL.ExecSQL(‘select * from t1’);

      dsResult.DataSet := FSQL;
      dsResult1.DataSet := FSQL1;

      end;

       

    • #55877
      VadimMest
      Participant

      1. I’ve found only autogenerated kbmmemtable700d.chm in kbmMemTable\Documentation from  04.19.2018  that is zero usefull. The Kbmmemtable700Man.pdf from customer portal   also cantains zero information how it works

      2.  Demo.dpr contains few SQL create table (table9) but no one example  how I can connect to this created table.

      When I wrote “The replacement for BDE”, I meant:

      • Create few tables, open datasets  with datasource and show these data in DbGrids (like TTable)
      • Connect to these tables and change data by UPDATE SQL or Check data by SELECT SQL (like TQuery)
      • Refresh  dataset and show modfied data in DbGrids

      Thanks

      Vadim Mescheryakov

       

       

       

      • This reply was modified 4 years, 8 months ago by VadimMest.
    • #55807
      VadimMest
      Participant

      Hello

      I created new TkbmMWClientQuery,TkbmMWClientConnectionPool,TkbmClient, TkbmMWPooledSession objects, I obtaned a new token for a new client object and now it works. Is it right solution?

      Thanks
      Vadim Mescheryakov

       

    • #55774
      VadimMest
      Participant

      Thanks!

       

    • #55558
      VadimMest
      Participant

      If I call ORM.Query with TkbmMWTransaction  it will work fine.

      Thanks
      Vadim Mescheryakov

       

       

       

    • #55495
      VadimMest
      Participant

      I look forward to

      Thanks

    • #55485
      VadimMest
      Participant

      Dear Kim

      >I will see if I can make it an easy built in support.

      I didn’t figure out how compress result. Did you make support for compress in current version kbmMW?

      Thanks
      Vadim Mescheryakov

    • #55484
      VadimMest
      Participant

      Hello

      This code works:
      orm.UpgradeTable(TArray<TClass>.Create(TMRDOC,TMRDOCROW));

      Thanks

      Vadim Mescheryakov

       

    • #55483
      VadimMest
      Participant

      Dear Kim

      I fixed your code for changing metadata in Firebird  tables (SQLDialect 1). I  changed some sql and data type definitions.

      Can I send changed units to you?

       

    • #55482
      VadimMest
      Participant

      Hello

      >DDL operations are usually not handled under transactional control in SQL.

      Procedure  orm.CreateOrUpgradeTable(TMROWNER) doesn’t finish a creating table in Firebird 2.5 and Firebird 3.  The table does not exists in database.
      In Firebird Database “CREATE TABLE”, “ALTER TABLE”  definitely need a Commit. I can send test project with Firebird based on your demo.

      I solved this problem with patch (but very many transaction start and commit)

      procedure TForm76.Button1Click(Sender: TObject);

      procedure CreateTable(const AValue: TClass);
      begin
      kbmMWInterbaseMetaData.RunMetaUpdatesInTransaction := True;
      orm.CreateTable(AValue);
      kbmMWInterbaseMetaData.RunMetaUpdatesInTransaction := False;
      end;
      begin

      if not orm.ExistsTable(TMRDOC) then
      CreateTable(TMRDOC)
      else
      orm.UpgradeTable(TMRDOC);

       

    • #55481
      VadimMest
      Participant

      Dear Kim

      Thanks!

       

    • #55438
      VadimMest
      Participant

      I try create new table by object TMRDOC (table MR_DOC)

      orm.CreateOrUpgradeTable(TMRDOC);

      How can I  turn on transaction commit?

      This is the SQL log:

      05.02.2021 22:24:30 n/a UniDAC monitoring is started Complete
      05.02.2021 22:24:36 0.109 Connect: SYSDBA@127.0.0.1 Complete
      05.02.2021 22:24:36 0.000 Start: Complete
      05.02.2021 22:24:36 0.000 Transaction ID = 78368 Complete
      05.02.2021 22:24:36 0.000 SQL Prepare: SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS
      WHERE ((RDB$SYSTEM_FLAG = 0) OR (RDB$SYSTEM_FLAG IS NULL)) AND
      (RDB$VIEW_SOURCE IS NULL) AND UPPER(RDB$RELATION_NAME)=’MR_DOC’
      Complete
      05.02.2021 22:24:36 0.000 SQL Execute: SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS
      WHERE ((RDB$SYSTEM_FLAG = 0) OR (RDB$SYSTEM_FLAG IS NULL)) AND
      (RDB$VIEW_SOURCE IS NULL) AND UPPER(RDB$RELATION_NAME)=’MR_DOC’
      Complete
      05.02.2021 22:24:36 0.000 SQL Unprepare: SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS
      WHERE ((RDB$SYSTEM_FLAG = 0) OR (RDB$SYSTEM_FLAG IS NULL)) AND
      (RDB$VIEW_SOURCE IS NULL) AND UPPER(RDB$RELATION_NAME)=’MR_DOC’
      Complete
      05.02.2021 22:24:36 0.000 SQL Prepare: SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS
      WHERE ((RDB$SYSTEM_FLAG = 0) OR (RDB$SYSTEM_FLAG IS NULL)) AND
      (RDB$VIEW_SOURCE IS NULL) AND UPPER(RDB$RELATION_NAME)=’MR_DOC’
      Complete
      05.02.2021 22:24:36 0.000 SQL Execute: SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS
      WHERE ((RDB$SYSTEM_FLAG = 0) OR (RDB$SYSTEM_FLAG IS NULL)) AND
      (RDB$VIEW_SOURCE IS NULL) AND UPPER(RDB$RELATION_NAME)=’MR_DOC’
      Complete
      05.02.2021 22:24:36 0.000 SQL Unprepare: SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS
      WHERE ((RDB$SYSTEM_FLAG = 0) OR (RDB$SYSTEM_FLAG IS NULL)) AND
      (RDB$VIEW_SOURCE IS NULL) AND UPPER(RDB$RELATION_NAME)=’MR_DOC’
      Complete
      05.02.2021 22:24:36 0.000 SQL Execute: CREATE TABLE MR_DOC ( DATEDOC TIMESTAMP,NDOC VARCHAR(20),IDSTATE INTEGER,GUID VARCHAR(36) PRIMARY KEY,ID INTEGER NOT NULL,IDOWNER INTEGER,IDINOWNER INTEGER,RECORDCOLOR VARCHAR(20),RECORDFONT VARCHAR(20),STATUS INTEGER )
      Complete

    • #55167
      VadimMest
      Participant

      Dear Kim

      This changing  breaks down function Unmarshal for some JSON

       

    • #55153
      VadimMest
      Participant

      Dear, Kim

      I’ve changed it. I replaced with mrt=mwrmrtObject and move this block under  “if mrt=mwrmrtCollection” block in two functions (Marshal and UnMarshal) and It did work.

      Thanks!

       

       

      • This reply was modified 5 years, 5 months ago by VadimMest.
    • #54668
      VadimMest
      Participant

      Hi

      What is the right way to add compressing in server response?
      1. Write new TkbmMWAJAXZipResponseTransportStream class (based on TkbmMWAJAXResponseTransportStream)
      2. Write new compressor  class (similar as TkbmMW LZ Compression)

      Thanks

       

    • #54594
      VadimMest
      Participant

      I’ve done it

      I added Self.SetResponseMimeType(

       

      f := TFileStream.Create(s1, fmOpenRead);
      ext := UpperCase(ExtractFileExt(AURL));
      if leftStr(ext, 1) = ‘.’ then
      ext := copy(ext, 2, length(ext) – 1);
      if ext = ‘APK’ then
      Self.SetResponseMimeType(‘application/vnd.android.package-archive’)
      else
      Self.SetResponseMimeType(GetMimeTypeExt(ext));
      Result := StreamToVariant(f);

       

      • This reply was modified 5 years, 11 months ago by VadimMest.
    • #54404
      VadimMest
      Participant

      I am so sorry. It’s work! I didn’t call procedure for classes registration

Viewing 31 reply threads