#1 Re: mORMot Framework » High-performance frameworks » Yesterday 21:17:38

ab wrote:

https://github.com/synopse/mORMot2/comm … 19ff2e806e
would change it into a TRWLock which will allow parallel search in the cache, without any spinning.

Mormot.rest.server needs also 3 renames from Trestcache to Tormcache

#3 Re: mORMot Framework » boolean fields are always false using INI config in TSynDaemonSettings » 2022-12-04 12:09:48

p^.Value.Kind is rkBool
p^.Prop^ is shown as TRttiProp but I can not have any of each properties in the debugger, and evaluating it as expression in the debugger I am getting "TRttiProp ()"

#4 mORMot Framework » boolean fields are always false using INI config in TSynDaemonSettings » 2022-12-03 21:27:18

dcoun
Replies: 4

A mormot2 daemon does not follow the configuration after an update. I using an inherited class from TSynDaemonSettings with extra properties in the published section and the config file is an INI file.
The same source compiled with Delphi it works ok, but with FPC all boolean directives are taking all the false value. I do not know from which version of Mormot it started to happen.
My FPC version is Lazarus 2.2.4 (rev lazarus_2_2_4-0-g06a78ed923) FPC 3.2.2 x86_64-win64-win32/win64 and even with last versions it is the same.
I tried for the first time the debugger from FPC and I found that the problem should be in line 4243 from mormot.core.data, "if p^.Prop^.SetValueText(Instance, v) then" but even with O0 optimization the debugger shows only assembly when calling this function and it is impossible for me to follow.
string and integers work without problem

Any ideas? Thank you in advance

#5 Re: mORMot Framework » THttpClientSocket.SockRecvLn error 10053 » 2022-12-03 07:31:39

You had right, I tried to find out what caused this error and I found it:
I had a THttpClientSocket object with an unauthorized interface service to create a JWT when needed without destroying and recreating the service interface. If more than 65 secs passed without using it and a request is done after that, using it, the above exception is created.

#6 Re: mORMot Framework » JWT, OnAuthentificationFailed, and interface services » 2022-12-03 06:44:25

Thank you a lot @ab. It works perfectly now with the JWTs from the client side.

#7 Re: mORMot Framework » JWT, OnAuthentificationFailed, and interface services » 2022-12-02 11:47:37

using OnAuthentificationFailed with result (true/false) and changing TRestClientUri.SessionHttpHeader it does not work
Also, SessionHttpHeader is added to headers once before the loop of OnAuthentificationFailed

#8 Re: mORMot Framework » JWT, OnAuthentificationFailed, and interface services » 2022-12-02 08:19:06

Thank you @ab, I have already searched the above forum threads.
I have already created the server side implementation and it works OK
My problem now is the client. From the above links  probably you mean the https://synopse.info/forum/viewtopic.ph … 051#p30051 but it is besed on sessions as far as I can understand
Do you propose a solution without sessions?

#9 mORMot Framework » THttpClientSocket.SockRecvLn error 10053 » 2022-12-02 07:35:33

dcoun
Replies: 2

Using THttpClientSocket to an interface service, I am getting the following in the log, but nothing is catch in except sections in my program, nor any unexpected attitude is trapped from my program.
Is it an internal http error that it is trapped and retried transparently to my code? if so, how can I exclude it from the logs?
Thank you in advance

20221202 07020721 EXC   ENetSock {Message:"THttpClientSocket.SockRecvLn error 10053 after 0 chars"} [xxdv0 BgdTmr] at 3be6e5 
20221202 07042923 EXC   ENetSock {Message:"THttpClientSocket.SockRecvLn error 10053 after 0 chars"} [xxdv0 BgdTmr] at 3be6e5

#10 mORMot Framework » JWT, OnAuthentificationFailed, and interface services » 2022-12-01 18:34:47

dcoun
Replies: 6

I am using a TRestHttpClientWinHttp to call inteface services in a  Mormot2 server and I am not using sessions.
As far as I can understand, Mormot2 does not support JWT by internal design.  There is no TRestClientAuthentication for JWTs.
In the server, I am checking if JWT header exists and if it is valid in each interface call

In the client, is it possible to use OnAuthentificationFailed event to refresh the expired JWT that the client should send in each interface call?

If I implement a timer based renew function running in the background, how can I protect the client from accessing the SessionHttpHeader during the timeframe it is set by the renew function?

Edit:
Is there an OnCall event that runs before a service inteface call is made by a TRestHttpClientWinHttp ? I noticed that SessionHttpHeader is added to headers once before the loop of OnAuthentificationFailed

Thank you in advance

#11 Re: mORMot Framework » mORMot2 compilation Error » 2022-12-01 09:05:11

Also:
[dcc32 Error] mormot.app.daemon.pas(868): E2016 Array type required

#12 Re: mORMot Framework » High-performance frameworks » 2022-11-11 07:09:48

mormot #30 & #52 position for the moment

#13 mORMot Framework » error messages in Delphi » 2022-11-08 08:12:29

dcoun
Replies: 1

Just two errors during compile in Delphi 11.2 to note for future correction

File: mormot.crypt.openssl
[dcc32 Error] mormot.crypt.openssl.pas(2776): E2251 Ambiguous overloaded call to 'BinToHex'
  System.Classes.pas(14010): Related method: procedure BinToHex(Pointer; PWideChar; Integer);
  System.Classes.pas(14077): Related method: procedure BinToHex(Pointer; PAnsiChar; Integer);
The second probably based on FPC

File: mormot.app.daemon line 753:
fStopper := [low(fStopper) .. high(fStopper)];

#15 Re: mORMot Framework » Can not compile with fileinfo in FPC/Linux » 2022-11-02 20:27:49

Example httpServerRaw with FPCUSEVERSIONINFO  enabled in FPC 3.2

Verbose: Compiling C:\delphi\G\mORMot2\src\app\mormot.app.console.pas
Verbose: Compiling C:\delphi\G\mORMot2\src\core\mormot.core.base.pas
Verbose: Compiling C:\delphi\G\mORMot2\src\core\mormot.core.os.pas
mormot.core.os.posix.inc(31,9) Error: Duplicate identifier "FileInfo"
mormot.core.os.posix.inc(31,9) Hint: Identifier already defined in mormot.core.os.pas at line 2602
mormot.core.os.pas(8357,0) Verbose: There were 1 errors compiling module, stopping

#16 mORMot Framework » Can not compile with fileinfo in FPC/Linux » 2022-10-30 18:35:42

dcoun
Replies: 3

Enabling Define FPCUSEVERSIONINFO in mormot.defines.inc causes problem in compilation with FPC and Linux x86 as target

mormot.core.os.posix.inc(31,9) Error: Duplicate identifier "FileInfo"

The problem might be that there is a function also named Fileinfo as the pascal unit.

#17 Re: mORMot Framework » Stopping a mormot2 server for update » 2022-10-30 15:19:32

The service daemon with the last updates works perfectly. I noticed that if you just run from the command line the service executable without options I can log an exception from the windows' Tservice but it is harmless.

Another point that needs to be handled better in windows is the platform independent commands in mormot.core.os to run an executable from a mormot server (RunProcess, RunCommand, etc)

In my scenario, the service periodically looks for updates. If it finds an available update, it downloads it and runs an other executable to do the update, the ServiceUpdater.
I have created this executable, the ServiceUpdater, using mormot framework that stops the service, unzips and replaces the executable and re-runs the service.
This executable does not work, if the services runs it. It waits for the service to stop till timeout.
Looking the code, I noticed that all mormot's commands from windows are based on Createprocess where the host process can not end before the executed process

I change the mormot's RunProcess/RunCommand to ShellExecute with command 'open' and now the service stops and the ServiceUpdater can continue to do the update.
Probably it could be included for windows. I will test this situation also in linux.

#18 Re: mORMot Framework » High-performance frameworks » 2022-10-30 07:11:56

#34 the mormot for the moment. I saw it also in #52

#20 Re: mORMot Framework » TRestClientDB or direct access to TRestServerDB for a server » 2022-10-29 10:57:52

pvn0 wrote:

is it better to use TRestServerDB's orm interface directly ?

that's how you're supposed to use it.  The only reason you can still call Add/Update/Delete directly from the TRestServerDB instance is because it's there for backwards compatibility with mORMot 1. If you define PUREMORMOT2 flag for your project then you will see those direct methods no longer available.

Thank you for response. I apologize, I am not sure I understand the response
Do you mean that I should use a TrestClientDB.Create(aRunningServer: TRestServerDB) ?
I already have enabled PUREMORMOT2, I create a TRestServerDB instance before the http server and I can still have access to TRestServerDB.orm.add

#21 mORMot Framework » TRestClientDB or direct access to TRestServerDB for a server » 2022-10-28 15:54:39

dcoun
Replies: 4

Looking an example from mormot2 I noticed that for standalone applications it exists also TRestClientDB that can be created to connect to external databases also through SQLITE.
I noticed that TrestClientDB can be created also with the following contructor:

    /// initialize the class, for an existing TRestServerDB
    // - the client TOrmModel will be cloned from the server's one
    // - the TRestServerDB and TSqlDatabase instances won't be managed by the
    // client, but will access directly to the server
    constructor Create(aRunningServer: TRestServerDB); reintroduce; overload;

Having all past problems with multiple threads trying to add to a database new records or updating others I am wondering:
When having multiple threads to use a TRestServerDB instance for the same tables, is it better to use TRestServerDB's orm interface directly ?
Or use one TrestClientDB instance for each thread with the above constructor called with the same TrestServerDB instance ?
What are the pros/cons?
Thank you in advance

PS I can not find the TSQLRestClientRedirect somewhere. Is it implemented?

Note: To help better understand my case:
I have clients that call a rest interface procedure but for a work that will take time and requests info from other API servers too. So the REST request is finished and the job is entered in a TSynThreadPool. So, later a thread will have to do all database work to provide the response through websockets. So, the above discussion is about threads running from a TSynThreadPool and accessing a main-central TRestServerDB instance.
I believe that a REST interface procedure in a server called by a client will not have problems to access a main-central TRestServerDB instance to do database work

#23 mORMot Framework » Stopping a mormot2 server for update » 2022-10-28 07:56:45

dcoun
Replies: 4

We have a windows service that runs a second executable that it is the real mormot2 server
The service has the responsibility to automatically update the mormot2 server executable when an update by the developer is available.
What will be a reliable way to update it?
We want to stop receiving new requests till the existing are served and closed, to terminate the server and the mormot2 server executable and to update the executable and restart it.
Killing the windows process is not a solution as I think. What do you propose?
Creating a rest function to request to finish? And if mormot2 is in dead-lock situation? And how do you find that a mormot2 server windows process is exited? By trying to delete or to modify the mormot2 executable as file?

In linux, we have the systemd for a number of linux distos
Do you run mormot2 server executable as a process controlled by systemd (to rely to databases being ready for example) or by eg rc.local?
How do you start it? Using -f or -r switch in TsynDaemon?
How do you stop it? Using SIGSTOP?
Again how is it better to look for updates and auto-update?
Do you run (and how do you initiate it) an other script to stop systemd service, update and restart it?

Let's consider that the update host and procedure to receive the updated version is safe discussing about security considerations

Thank you in advance

#24 mORMot Framework » Define SectionName in TSynDaemonSettings when saving in INI » 2022-10-27 19:47:43

dcoun
Replies: 1

Is it possible to set the SectionName when loadin/saving in ini format the TSynDaemonSettings ?
Both IniToObject/ObjectToIni have this option and it needs just to be set in TSynJsonFileSettings.LoadFromJson and TSynDaemon.Create

Thank you in advance

https://github.com/synopse/mORMot2/pull/125

#27 Re: mORMot Framework » mORMot 2 - Project05HttpDaemon 64bit Error » 2022-10-26 07:58:39

Clean from github, last commit + the code you requested above
Alexandria 11.2 patch1
Only added win64 target

https://gist.github.com/dkounal/63adc5a … 01c26c29a9

#29 Re: mORMot Framework » mORMot 2 - Project05HttpDaemon 64bit Error » 2022-10-24 17:03:52

I tried it the weekend and I noticed that it creates an exception when trying to create the service
mormot.core.windows.inc

function TServiceController.Start(const Args: array of PChar): boolean;
begin
  if length(Args) = 0 then
    result := StartService(fHandle, 0, nil)
  else
    result := StartService(fHandle, length(Args), @Args[0]);
end;

tried admin account, same problem

#30 Re: mORMot Framework » parameter in the beginning of sql query and exception: zeos or mormot? » 2022-10-24 16:46:53

ab wrote:

From TSqlDBStatement.ExecutePreparedAndFetchAllAsJson ?

In TSqlDBZeosStatement.ExecutePrepared from mormot.db.sql.zeos the fStatement.GetSQL returns the correct query:

select pid as ID from table where am=? limit 1

#31 Re: mORMot Framework » parameter in the beginning of sql query and exception: zeos or mormot? » 2022-10-24 06:30:48

Problem found again today. From logs it happens after mormot2 enters zeos' pas units, after exceptions to other sql queries and probably due to the sqlwriter that creates the query for zeos.
Reported to zeos forum and waiting approval. To be honest, I feel uncertain using zeos for the future.
I transformed most insert queries to Trestbatch where insert ignore is available. Anyway time penalty with memberexists is the same.

#32 Re: mORMot Framework » parameter in the beginning of sql query and exception: zeos or mormot? » 2022-10-22 16:40:08

ab wrote:

AcquireExecutionMode[] is for remote REST access, not direct IRestOrm access.

Ok I will remove it. I noticed that it is needed if TSQLDBZEOSConnectionProperties.ConnectionTimeOutMinutes is set.

// - warning: no connection shall still be used on the background (e.g. in
    // multi-threaded applications), or some unexpected issues may occur - for
    // instance, ensure that your mORMot ORM server runs all its statements in
    // blocking mode for both read and write:
    // ! aServer.AcquireExecutionMode[execOrmGet] := am***;
    // ! aServer.AcquireExecutionMode[execOrmWrite] := am***;
    // here, safe blocking am*** modes are any mode but amUnlocked, i.e. either
    // amLocked, amBackgroundThread or amMainThread
    property ConnectionTimeOutMinutes: cardinal
      read GetConnectionTimeOutMinutes write SetConnectionTimeOutMinutes;

ab wrote:

OneFieldValue() does not use the WriteLock.

Sure, I have not this error the last two days since I put a WriteLock in an other place of my program where multiple threads could try at the same time to add in an other table the same row info.
Looking in orm.add I noticed that it has a lock, why a WriteLock for an orm.add stopped this error?

#33 Re: mORMot Framework » parameter in the beginning of sql query and exception: zeos or mormot? » 2022-10-22 09:31:09

Finally Orm.WriteLock/WriteUnLock when used in other parts of my program when multiple threads call add in the same table probably the same record (same IDValue). I also defined the ZEOS_DISABLE_POOLED directive in zeoslib
Just wondering why the following lock that exists in Orm.InternalAdd does not help and I have to use Orm.WriteLock/WriteUnLock

  fRest.AcquireExecution[execOrmWrite].Safe.Lock;
  try
    // may be within a batch in another thread -> use execOrmWrite lock
    result := EngineAdd(t, json); // will call static if necessary
  finally
    fRest.AcquireExecution[execOrmWrite].Safe.UnLock;
  end;

I am using Mariadb with

AcquireExecutionMode[execOrmGet]:=amBackgroundThread;
AcquireExecutionMode[execOrmWrite]:=amBackgroundThread;

#34 Re: mORMot Framework » memberexists does not help » 2022-10-21 10:53:32

ab wrote:

Note that insert/or/ignore is not exactly the same as update/or/insert.

Take a look at EncodeInsertPrefix() in mormot.db.core.pas.
We did not include Oracle yet because it is very complicated to get it working properly. As often with Oracle.
And PostgreSQL also expect a complex syntax with the column names to ignore, as On CONFLICT(column1, ....) DO NOTHING;.

I am not familiar with Oracle and Firebird
Firebird,  Oracle, Postgres do not have an 'INSERT [OR] IGNORE' dialect

For Oracle I have included the info

For firebird >2.1 is just a little more complex (you have to provide the unique indexes) as described here:
https://firebirdsql.org/refdocs/langref … nsert.html

For postgres  >9.5 nearly the same with firebird
INSERT INTO table(column1, column2, ...)
VALUES
  (value1, value2, ....),
  (value1, value2, ....)
On CONFLICT[(column1, ....)] DO NOTHING;
https://www.postgresql.org/docs/10/sql-insert.html

#35 Re: mORMot Framework » memberexists does not help » 2022-10-21 09:21:33

From a small search, INSERT IGNORE is supported by SQLITE, postgres, Oracle, mysql, mariadb,firebird
SQLITE,mysql : INSERT IGNORE
Oracle: INSERT .... IGNORE_ROW_ON_DUPKEY_INDEX
Firebird: UPDATE OR INSERT

For Oracle there is enough info:
https://blogs.oracle.com/sql/post/how-t … e-database
http://guyharrison.squarespace.com/blog … -hint.html (old article)

#36 Re: mORMot Framework » memberexists does not help » 2022-10-21 08:14:54

Thank you a lot @ab
check also the above discussion
Probably adding ignore to INSERT is a better approach

#37 Re: mORMot Framework » memberexists does not help » 2022-10-21 07:35:28

Reading the following response from overflow:


REPLACE INTO table(column_list) VALUES(value_list);

is a shorter form of

INSERT OR REPLACE INTO table(column_list) VALUES(value_list);

For REPLACE to execute correctly your table structure must have unique rows, whether a simple primary key or a unique index.

REPLACE deletes, then INSERTs the record and will cause an INSERT Trigger to execute if you have them setup. If you have a trigger on INSERT, you may encounter issues.

This is a work around.. not checked the speed..

INSERT OR IGNORE INTO table (column_list) VALUES(value_list);

followed by

UPDATE table SET field=value,field2=value WHERE uniqueid='uniquevalue'

This method allows a replace to occur without causing a trigger.

Probably an insertOrIgnore (or an extra boolean flag in add to add 'or ignore') is better for this case and it is supported by sqlite

#38 Re: mORMot Framework » memberexists does not help » 2022-10-21 07:30:55

Thank you @ab. Please try to have a replace function as we have  add/update for ORM

An other question:
If I use a batch, how can I add to the batch a sql command for multiple rows like the following:

update table set act=0

Thank you in advance

#39 mORMot Framework » memberexists does not help » 2022-10-20 18:32:58

dcoun
Replies: 8
var b:boolean;
      o:TOrmamyclass;
......
 if srv.Orm.MemberExists(TOrmamyclass,o.IDValue) then b:=srv.Orm.Update(o) else b:=srv.Orm.Add(o,true,true)=o.IDValue;

The above does not work all the times, I am getting:

Exception: 20221020 16294225  " EXC   EZSQLException {Message:"SQL Error: Duplicate entry '1611284410' for key 'PRIMARY' \r\nCode: 1062 SQL: insert into amyclass (bid,xml,stat) values (?,?,?)"} [Pool7-TEpresslave] at 0235e59a ZDbcMySql.pas TZMySQLConnection.HandleErrorOrWarning (1271)  ZDbcMySql.pas TZMySQLConnection.HandleErrorOrWarning (1271) ZDbcMySqlStatement.pas TZAbstractMySQLPreparedStatement.ExecuteUpdatePrepared (1150) mormot.db.sql.zeos.pas TSqlDBZeosStatement.ExecutePrepared (1204) mormot.orm.sql.pas TRestStorageExternal.ExecuteFromJson (2096) mormot.orm.sql.pas TRestStorageExternal.EngineAdd (1249) mormot.orm.rest.pas TRestOrm.Add (1725) .........

There are not many threads that try to write the same thing
Without ORM I used to have a REPLACE sql command. Now what to do?
After the above, everything goes out of control with "Commands out of sync" and that generally happens if such an error (duplicate primary key or field out of range) happens
Delphi 11.2 win32

#40 Re: mORMot Framework » parameter in the beginning of sql query and exception: zeos or mormot? » 2022-10-12 16:44:27

ab wrote:

The log states SQL: select ID from apimans where am=? limit 1" in the 3rd line, which seems correct.

Try
1. to add some logs to see what is actually executed.
2. to add some critical section lock/unlock around the ORM call to see if there is a multi-thread problem.
3. to ask also from help on the Zeos support forum.

can you help me a bit about the 2?
It runs in threads. What is the orm calls what should be protected more with a critical section? Should I use the orm.Writelock/orm.writeunlock for each Insert/update/delete sql command?
Thank you in advace

#41 mORMot Framework » parameter in the beginning of sql query and exception: zeos or mormot? » 2022-10-12 14:51:31

dcoun
Replies: 9

Running the following

DBsrvPool.GetDBsrv.Orm.OneFieldValue(TOrmapimans,'RowID','am=:('+inttostr(am)+'):')

Sometimes, I get sometimes the following error:

Exception: 20221011 18040212  ) EXC   EZSQLException {Message:"
SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version 
for the right syntax to use near '13100000113select ID from apimans where am=? limit 1' at line 1 \r\nCode: 1064 
SQL: select ID from apimans where am=? limit 1"} [] at 01ccb696 
ZDbcMySql.pas TZMySQLConnection.HandleErrorOrWarning (1271)  
ZDbcMySql.pas TZMySQLConnection.HandleErrorOrWarning (1271) 
ZDbcMySqlStatement.pas ExecuteEmulated (1039) 
ZDbcMySqlStatement.pas TZAbstractMySQLPreparedStatement.ExecuteQueryPrepared (1051) 
mormot.db.sql.zeos.pas TSqlDBZeosStatement.ExecutePrepared (1179) 
mormot.db.sql.pas TSqlDBStatement.ExecutePreparedAndFetchAllAsJson (6664) 
mormot.orm.sql.pas TRestStorageExternal.EngineList (1380) 
mormot.orm.server.pas TRestOrmServer.EngineList (1073) 
mormot.orm.rest.pas TRestOrm.ExecuteList (1675) 
mormot.orm.rest.pas TRestOrm.MultiFieldValue (976) 

As you can notice the parameter is in the beginning of the sql query. Is it Mormot's fault or Zeos's?

I am using Mormot2, Delphi 11.2 and Zeoslib 8.0-patches from github

#43 Re: mORMot Framework » PopHead in TDynArray will try finalize an 'object' if is not null » 2022-10-09 19:13:11

The definition is:

lowr:ilist<TepGenericSlave>;

The creation is:

lowr:=Collections.NewList<TepGenericSlave>;

The pop is used like the following and produces exceptions:

TepGenericSlave=class
....

obj:=TepGenericSlave.create;
...
repeat
...
lowr.Pop(obj,[popFromHead]);
...
until ....;

The pop is used like the following and does not produce exceptions:

TepGenericSlave=class
....

obj:=TepGenericSlave.create;
...
repeat
...
obj:=nil;
lowr.Pop(obj,[popFromHead]);
...
until ....;

#44 mORMot Framework » PopHead in TDynArray will try finalize an 'object' if is not null » 2022-10-09 16:16:58

dcoun
Replies: 4

I was getting random exceptions from an ilist with objects
The exception is coming from mormot.core.data line 6988 (fInfo.ArrayRtti.ValueFinalize)

procedure TDynArray.ItemMoveTo(index: PtrInt; Dest: pointer);
var
  p: pointer;
begin
  p := ItemPtr(index);
  if (p = nil) or
     (Dest = nil) then
    exit;
  if (fInfo.ArrayRtti <> nil) and
     not fNoFinalize then
    fInfo.ArrayRtti.ValueFinalize(Dest); // also handle T*ObjArray
  MoveFast(p^, Dest^, fInfo.Cache.ItemSize);
  FillCharFast(p^, fInfo.Cache.ItemSize, 0);
end;

which is called by same unit, line 6858

function TDynArray.PopHead(var Dest): boolean;
begin
  result := GetCount <> 0;
  if result then
  begin
    ItemMoveTo(0, @Dest);
    Delete(0);
  end;
end;

The problem was that the object variable passed to pophead was not null and before poping the new object  ItemMoveTo try to finalize it.
probably adding a Dest:=nil; somewhere before ItemMove in PopHead?
Or, probably adding this requirement (dest must be nil) in Pop's documentation?

#45 Re: mORMot Framework » Delphi FMX Android client? » 2022-10-05 08:59:19

ab wrote:

My CE license expired a few years ago, and I failed to renew it.
EMB licensing is a real PITA.

And IIRC 10.4 had no shortstring support.

shortstring was renabled in 10.4
CE license can not be renewd from what I read, you have right they are problematic.
You uninstall it and you reinstall it with registry cleared

#46 Re: mORMot Framework » Delphi FMX Android client? » 2022-10-05 06:43:56

ab wrote:

It is difficult to me to help without a proper Delphi compiler...

sad

Delphi 10.4 community edition is free for not commercial purposes
Its android version is a bit old but only google playstore rejects its executables, you can test it in devices+emulators+amazon playstore+windows 11

#48 Re: mORMot Framework » Delphi FMX Android client? » 2022-09-28 21:51:43

ab wrote:

Main mORMot 2 units have no Delphi Android/iOS/Linux support yet.
But in mORMot 2, it could be easier to do, since almost all OS specific code is within mormot.core.os.pas. So any input is welcome.

Probably I am not adding anything new, but, mormot.core.base can not be compiled and has no further dependencies

#49 Re: mORMot Framework » Is there a different timeout when calling an interface procedure? » 2022-09-24 18:05:07

Just an other problem with RetrieveListJson and LIMIT/OFFSET
I am running the following command:

srvdb.Orm.RetrieveListJson(TormRepErrors,'dat > :(20220913): AND dat < :(20220925): ORDER BY dat DESC LIMIT 20 OFFSET 0',[],'*');

The query returned by mormot.orm.sql 's TRestStorageExternal.AdaptSqlForEngineList(var SQL: RawUtf8): boolean; is

select ID,dat,typ,mid,termnam,mariadbver,pchrver,user_ as user,ctid,app,uid,dver,build,msg from reperrors where dat>:(20220913): and dat<:(20220925): order by dat desc limit 20

The next page will be retrieved with

srvdb.Orm.RetrieveListJson(TormRepErrors,'dat > :(20220913): AND dat < :(20220925): ORDER BY dat DESC LIMIT 20 OFFSET 20',[],'*');

But now the query returned by mormot.orm.sql 's TRestStorageExternal.AdaptSqlForEngineList(var SQL: RawUtf8): boolean; is

SELECT RowID,dat,typ,mid,termnam,mariadbver,pchrver,user,ctid,app,uid,dver,build,msg FROM RepErrors WHERE dat > :(20220913): AND dat < :(20220925): ORDER BY dat DESC LIMIT 20 OFFSET 20

Can you notice that the first return is "ID" but in the second it is returning a "RowID"? it seems that in the second, it does not "touch" the initial query.
The problem is that resulting JSON has different the first field if searched by name

#50 Re: mORMot Framework » Is there a different timeout when calling an interface procedure? » 2022-09-24 17:05:59

So, no exception now and it works
I will try it again now with websockets.
I noticed that you are doing an excellent work with Letsencrypt. When will it be ready to test it?
as alternate what is the correct configuration in nginx  for using >100 clients with websockets behind nginx?

Board footer

Powered by FluxBB