Forum Replies Created
-
AuthorPosts
-
-
February 6, 2024 at 14:54 #57469
VadimMest
ParticipantThis may be an issue in Swaggers scripts.
-
February 6, 2024 at 07:53 #57468
VadimMest
ParticipantI 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 -
January 18, 2024 at 15:55 #57440
VadimMest
ParticipantYes.
I installed Swager UI. Server doesn’t call a function OpenAi (?url=/myserver/api) -
December 13, 2021 at 09:30 #56113
VadimMest
ParticipantThe 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?
-
December 3, 2021 at 10:50 #56070
VadimMest
ParticipantBut in the real life the client misses files and my version control system doesn’t work properly.
-
December 3, 2021 at 10:03 #56069
VadimMest
ParticipantAll Integer fields values don’t restored from xml
-
December 3, 2021 at 09:46 #56068
VadimMest
Participant -
November 30, 2021 at 08:06 #56050
VadimMest
ParticipantMaybe 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.
-
This reply was modified 4 years, 3 months ago by
-
November 13, 2021 at 09:20 #56023
VadimMest
ParticipantNo, 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?
-
November 13, 2021 at 06:11 #56022
VadimMest
ParticipantDear 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?
-
November 12, 2021 at 18:52 #56021
VadimMest
ParticipantThe 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?
-
October 30, 2021 at 08:16 #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 versionTry to open kbmmw\source\d104\*.dfm and remove absent properties. Check library path for versions of dfm
Best Regards
Vadim Mescheryakov -
July 14, 2021 at 13:54 #55888
VadimMest
ParticipantFew 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 🙂 -
July 14, 2021 at 05:07 #55887
VadimMest
ParticipantI found two solutions:
- TKbmMemSQL (only for creating a table) + TKbmMemtable + TVirtualQuery (from DevArt UNIDAC) works properly.
- Changing ‘Create table’ from SQL Statement to AddField + TVirtualTable + TVirtualQuery also works properly and faster than the first solution
-
July 13, 2021 at 20:19 #55886
VadimMest
ParticipantThanks, 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 -
July 9, 2021 at 17:03 #55880
VadimMest
Participantprocedure 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;

-
July 9, 2021 at 16:20 #55877
VadimMest
Participant1. 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.
-
May 28, 2021 at 13:50 #55807
VadimMest
ParticipantHello
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 -
May 18, 2021 at 16:00 #55774
VadimMest
ParticipantThanks!
-
March 2, 2021 at 06:22 #55558
VadimMest
ParticipantIf I call ORM.Query with TkbmMWTransaction it will work fine.
Thanks
Vadim Mescheryakov -
February 23, 2021 at 18:36 #55495
VadimMest
ParticipantI look forward to
Thanks
-
February 19, 2021 at 06:47 #55485
VadimMest
ParticipantDear 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 -
February 19, 2021 at 06:40 #55484
VadimMest
ParticipantHello
This code works:
orm.UpgradeTable(TArray<TClass>.Create(TMRDOC,TMRDOCROW));Thanks
Vadim Mescheryakov
-
February 19, 2021 at 06:35 #55483
VadimMest
ParticipantDear 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?
-
February 19, 2021 at 06:29 #55482
VadimMest
ParticipantHello
>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;
beginif not orm.ExistsTable(TMRDOC) then
CreateTable(TMRDOC)
else
orm.UpgradeTable(TMRDOC); -
February 19, 2021 at 06:02 #55481
VadimMest
ParticipantDear Kim
Thanks!
-
February 6, 2021 at 07:04 #55438
VadimMest
ParticipantI 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 -
October 12, 2020 at 07:04 #55167
VadimMest
ParticipantDear Kim
This changing breaks down function Unmarshal for some JSON
-
October 8, 2020 at 09:28 #55153
-
April 28, 2020 at 17:51 #54668
VadimMest
ParticipantHi
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
-
April 13, 2020 at 12:14 #54594
VadimMest
ParticipantI’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.
-
This reply was modified 5 years, 11 months ago by
-
January 17, 2020 at 16:40 #54404
VadimMest
ParticipantI am so sorry. It’s work! I didn’t call procedure for classes registration
-
-
AuthorPosts
