You are not logged in.
Pages: 1
The mORMot 2 framework is about to be released as its first 2.0 stable version.
I am currently working on preliminary documentation.
Some first shot here https://synopse.info/files/doc/mORMot2.html
At least we can use SynProject to generate it.
The framework feature set should now be considered as sealed for this release.
There is no issue reported opened at https://github.com/synopse/mORMot2/issues or in the forum.
Please test it, and give here some feedback to fix any problem before the actual release!
We enter a framework code-freeze phase until then.
I have refactored the forum topics, so a new dedicated "mORMot 2" forum is to be used.
https://synopse.info/forum/viewforum.php?id=24
The previous forum was renamed "mORMot 1" and should now be used only about this former version, which is now considered in maintenance-only mode.
Blog article of this forum thread:
https://blog.synopse.info/?post/2023/01 … -Candidate
Offline
Please test it, and give here some feedback to fix any problem before the actual release!
Some tips.
1. In configuration as below, where one REST registered in http and https servers, websockets works only for last registered server (HttpsServer in that case).
It may be fixed (can be difficult) or at least documented.
var
Server: TRestServerFullMemory;
HttpServer: TRestHttpServer;
HttpsServer: TRestHttpServer;
begin
Server := TRestServerFullMemory.CreateWithOwnModel([]);
HttpServer := TRestHttpServer.Create('80', [Server], ...);
HttpServer.WebSocketsEnable(Server, '').
HttpsServer := TRestHttpServer.Create('443', [Server], ...);
HttpsServer.WebSocketsEnable(Server, '').
end;
2. Next, in TRestServerUriContext.FillInput I changed limit from 128 parameters to 512 parameters, because I use DataTables Javascript library (https://datatables.net/). And it uses up to a dozen parameters per table column. So 128 is not enough.
Offline
I have a problem with TRestHttpServer too
This is my test code (mORMot1 is Ok, mORMot2 is fail)
https://gist.github.com/delphiapp/95640 … 858068f326
The line where is a problem - 884 mormot.rest.http.server;
log.Log(sllHttp, '% initialized for %', [fHttpServer, fDBServerNames], self);
Last edited by Alek (2023-01-10 06:11:46)
Offline
Thanks a lot for your input!
@Chaa
1. It is already documented as such I guess: WebSocketsEnable() "defines the WebSockets protocols used by useBidirSocket/useBidirAsync"'.
It means that WebSocketsEnable requires a websockets-enabled kind of server, i.e. one HTTP_BIDIR mode, whereas without any option it uses HTTP_DEFAULT_MODE on Windows, which is http.sys (useHttpApiRegisteringURI) so is not websockets-ready.
You need to specify WEBSOCKETS_DEFAULT_MODE for both HttpServer instances.
I have made the exception more explicit https://github.com/synopse/mORMot2/commit/e20140c9
2. See https://github.com/synopse/mORMot2/commit/52e33fdc
@Alek
I can't reproduce your problem with your gist. The project runs with no problem.
Even if I add TSynLog.Family.Level := LOG_VERBOSE; at the begining. And I get the expected logs.
Please define what "fail" means in your case, and which compiler and system you use.
Offline
I used Delphi 2006 Compiler and Stable Lazarus 2.2.4 Win32. In mORMot2 I got Access Violation from adress $00000000 when the programm is started
I have added compilation capability in Lazarus
Offline
It means that WebSocketsEnable requires a websockets-enabled kind of server, i.e. one HTTP_BIDIR mode
In previous example I use two useBidirSocket servers, one for HTTP, and one for HTTPS. But REST-server NotifyCallback can be used only with one useBidirSocket server (last registered).
Also, ConnectionID of those two useBidirSocket servers is the same, so we can not distinguish between them in IsActiveWebSocket, even if we can call NotifyCallback of all HTTP-servers.
Offline
@Chaa
Now I understand.
This is indeed a limitation, but in practice, you should redirect all HTTP traffic to HTTPS. So the server on port 80 should just redirect to the other server on port 443.
I have documented this limitation.
And it will now raise an explicit exception in such case:
https://github.com/synopse/mORMot2/commit/09eb71a3
Offline
@Alek
Now I can reproduce the problem.
Should be fixed by https://github.com/synopse/mORMot2/commit/a8df75ae
Offline
2. Next, in TRestServerUriContext.FillInput I changed limit from 128 parameters to 512 parameters, because I use DataTables Javascript library (https://datatables.net/). And it uses up to a dozen parameters per table column. So 128 is not enough.
On the real life the URL length is limited (by web browser, by proxies, by CDNs etc). I've encountered such limitation several times. The best practice is to keep URL length < 2000 (so 128 parameters is far enough IMHO).
Offline
Another unsolved problem is the incorrect operation of the _ObjArrayClear function
I also get access violation
https://gist.github.com/delphiapp/33c66 … e87c51c4cf
because line 5822 file mormot.core.rtti is
RawObjectsClear(pointer(V), PDALen(PAnsiChar(V^) - _DALEN)^ + _DAOFF); in this function
must be
RawObjectsClear(V^, PDALen(PAnsiChar(V^) - _DALEN)^ + _DAOFF);
Offline
@Alek
You are right.
Should be fixed now with
https://github.com/synopse/mORMot2/commit/4dc828fc
Sorry for having missed this.
Offline
It would probably be a good idea to update https://synopse.info/fossil/wiki?name=Downloads page and to include m2 info/links and m2 NightlyBuild.
Offline
AB, congratulations on reaching the milestone!
Synopse mORMot 2 is an Open Source Client-Server ORM SOA MVC framework for Delphi 7 up to Delphi 11 Alexandria and FPC 3.2/trunk, targeting Windows/Linux/BSD/MacOS for servers, and any platform for clients (including mobile or AJAX).
Does it mean, that mORMot2 supports Delphi 11 Linux compiler?
UPD:
'Kylix or Delphi for MacOS/Linux/Mobile are unsupported'
'-> we recommend using FPC for POSIX platforms'
Last edited by George (2023-01-10 21:16:30)
Offline
@Igor
I think I will suspend the whole fossil/wiki part, and let it dedicated to mORMot 1.
The new website will only link directly the forum and the github repository.
Perhaps some gitpages for the presentation itself in the future...
@George
No, it means that it supports Linux with FPC.
I don't have any Delphi for Linux license, so I can't make any adaptation.
And from what I have heard, the FPC support is much better for Linux than Delphi, and we got tremendous performance with FPC on Linux.
Offline
On the real life the URL length is limited (by web browser, by proxies, by CDNs etc). I've encountered such limitation several times. The best practice is to keep URL length < 2000 (so 128 parameters is far enough IMHO).
Yes, for GET requests parameters is limited to 2000-4000 bytes, but for POST there is no such limits (DataTables uses POST).
Offline
Can we make PostgreSQL pipelining optional (in mormot.db.raw.postgres.pas)?
My problem: I create Windows 32-bit application, and use 32-bit libpq.dll. But 32-bit builds available only up to version 12, and has no pipelining support.
Version 14 with pipelining support has only 64-bit builds.
So now I changed ESqlDBPostgres to nil in call to Resolve.
May be there is a 32-bit libpq.dll with pipelining?
Offline
@@Chaa
Please try https://github.com/synopse/mORMot2/commit/3cebbb39
Pipelining is used only manually, not from the ORM.
Now it should raise an exception only when EnterPipelineMode is called and the API does not support it.
Offline
Variable "raiseonfailure" is not initialized to ESqlDBPostgres on function start.
Offline
Hi Arnaud,
in mormot.db.core, you define _ENDCLAUSE (line 2410) with different options, suche as left, right, ..., how about adding WHERE itself? Would make it easier, when we build a where clause, that could be used in different contexts.
Regards,
Daniel
Offline
BTW - names for TDynArraySortCompare SortDynArray* functions family (SortDynArrayInt64, ....) are very confusing (DynArray part in name). I understand such naming reason - it's because of FPC TListSortCompare naming, but in fact these functions not related to DynArray at all and can compare not only DynArray elements, and not only for sorting purpose, right?
May be (before mORMot2 is not released) rename all of them to Compare* (CompareInt64, ...) and family itself to TCompare. Or TfnCompare -> fnCompareInt64, fnCompareQWord etc to prevent possible conflicts.
Offline
DynArray*() functions are really used in the TDynArray context.
They share the same parameters signature, as needed by TDynArray, which is of untyped const kind, i.e. something opaque always passed by reference:
TDynArraySortCompare = function(const A, B): integer;
There are already CompareInt64() and such functions, which properly inline when needed, and which have the actual parameter types (e.g. Int64 for CompareInt64).
Offline
In 64-bit Linux type THandle cannot be used in resource management functions, because it's 32-bit file handle, but HInstance handles are 64-bit. This leads to Access Violation error. We must use PtrUInt (or TLibHandle) instead.
I see problems in:
ResourceToRawByteString, ResourceSynLZToRawByteString, TExecutableResource, TSynTimeZone, TZipRead.
Offline
Offline
Pointing out request in #20 again :-)
https://synopse.info/forum/viewtopic.ph … 842#p38842
Offline
Thank's, now it works.
But there's another problem after I updated mORMot:
Before, I changed FavIcon by assigning TRestHttpServer.FavIcon property.
Now, after adding URI routing, if I try to call HttpServer.SetFavIcon, there is an exception EUriRouter with message 'TUriRouter.Setup('/favicon.ico'): already registered'.
So, I not see the way of how to change FavIcon.
Offline
@Chaa
Please try https://github.com/synopse/mORMot2/commit/f44cfd18
@Sakura
Please try https://github.com/synopse/mORMot2/commit/252faceb
Offline
@ab - one request for future mORMot2 release - please, compress static in mormot2 release using tar.gz. 7z is not available in default distribution (on both Linux and Windows), and installing p7zip package, for example inside docker build as we do in TFB bench, just to decompress mormot2static.7z takes some time, and worst what it require internet connection - I sometimes have problem with Internet after missile attacks
Last edited by mpv (2023-02-15 22:13:01)
Offline
The mORMot 2 official release is out!
In fact, the RC standed for almost two months, and we eventually added some new features, like LDAP and DNS clients.
And a lot of optimizations to the web servers.
@mpv
I have now compressed the static into both .7z and .tgz format.
It is clearly more convenient on POSIX to have a .tgz content, and on Windows, I guess the .7z format is likely to be available on the developer system.
Please check
https://github.com/synopse/mORMot2/rele … 2.0.stable
Offline
Congratulations!!! Many many thanks for your work
Offline
A lot of waiting, but at least, we have increased the version number to 2.1.
The easiest may be perhaps to follow more or less the SQLite3 release time.
So I guess we will release 2.1.stable some weeks after SQlite3 will be released as 3.42.0 version.
Offline
Congratulations!!! thank you ab!
Offline
厉害
Offline
@ab - a see you adding an LDAP client. Just a note - I switch to libldap (on both Win/Lin) ~5 years ago - this is the only implementation what I fund what works correctly with ADFS. And most enterprises uses ADFS. Do not remember yet what exactly should be done to support LDAP in federation mode - may be additional steps for selecting active LDAP server from pool etc. - libldap solves this out from the box
Offline
Pages: 1