You are not logged in.
I don't know such page with detailed description of each FPC branch.
In general FPC "fixes3.2" seems like right choice for now. The stable 3.2 was not released yet and AFAIK the fixes3.2 is the base for incoming 3.2 stable release.
about Lazarus: Lazarus version has no meaning (it can be eventually more or less comfortable for end user including not working, but you should be able to use FPC from command line ). IMO always is worth to try new Lazarus for better UX.
You cannot expect from trunk any stability. Only "patches/fixes" branch and "stable" releases are stable.
No idea yet, this needs investigation. Probably some internal changes in RTTI layout (maybe even compiler bug). Try to use "fixes3.2" in fpcupdeluxe FPC Version instead of trunk.
Probably you should add to Synopse.inc the new directive:
{$modeswitch prefixedattributes-}
the problem is related to initial support of attributes in latest FPC trunk.
The first problem can be partially solved via custom TSQLRestServer.OnSessionCreate.
The second part can be solved via custom TAuthSession:
type
TCustomAuthSession = class(TAuthSession)
procedure ComputeProtectedValues; override;
end;
procedure TCustomAuthSession.ComputeProtectedValues;
begin
inherited;
fTimeOutShr10 := (QWord(User.GroupRights.SessionTimeout)*(1000))shr 10;
Inc(fTimeOutShr10);
fTimeOutTix := GetTickCount64 shr 10+fTimeOutShr10;
end;
...
MyServer.SessionClass := TCustomAuthSession;
Default precision is in approximation one second so all seems fine.
Hi,
I found two problems with sessions.
The first:
when TSQLServer has single user and reOneSessionPerUser is used in TSQLAuthGroup.AllowRemoteExecute set, then the session is never released (deleted) even when session time out occurred.
Second:
the precision of timeout is too low for some automation processes (for example for bot clients). The minimal timeout can be set to one minute, IMO should be possible to set such timeout to second/few seconds in some cases. The behavior cannot be changed in simple way. The usefully would be virtual TSQLRestServer.SessionAccess (current SessionAccess cannot be overridden) or some other solution.
here is pull request (merged with latest mORMot) https://github.com/synopse/mORMot/pull/183 extracted from warleyalex archive.
Without improved examples - I have only SMS free compiler so examples are not validated by me. I was able to compile some small project with latest SMS compiler.
Thanks warleyalex!
AFAIK usage of ZEOS 7.3 is risky (in one of my bugreport (ZEOS bugtracker at sourceforge) some time ago I was warned that I should use 7.2). The recommended version is https://sourceforge.net/p/zeoslib/code- … .2-patches
Anyway whatever was said I was using selected 7.3 with important fixes for me ( PostgreSQL ). You can try to isolate minimal test case and use ZEOS bugtracker at sourceforge to report the problem.
yes but "hacker/attacker" is able to logout user without user knowledge. AFAIK this is still actual : https://synopse.info/forum/viewtopic.php?id=2996
Note that Google or others do send plain passwords over HTTPS, so the mORMot handshake protocol is more secure for sure - at least you can never see the password, and can't replay an old signature!
the only what is possible is usage of current/latest signature to logout user ^^!
Worth to note that OnBeforeBody behaves in different way for http.sys and socket server. For the http.sys OnBeforeBody is executed only when body exist but for sockets server OnBeforeBody is executed always (even when body is empty).
We have plan to support this in NewPascal
@hnb,
What were you banned and can you point me to the page of the relative discussion?
to get full picture you need to track April/May mailing list archives (you can read all discussion by clicking "Next message (by thread)" in bottom):
http://lists.freepascal.org/pipermail/f … 38863.html
http://lists.freepascal.org/pipermail/f … 38880.html
after my last message I have got permanent ban - I have no access to SVN FPC repository/trunk nor internal "core mailing list".
TLTR, the general summary (this was not first situation):
This was some time ago, when I was part of FPC core team and NewPascal was almost integrated with official FPC page... Now I have ban in FPC core mailing list and I don't have access to trunk anymore - there is no rational reason for my banishment... I am not able to provide any updates, bug fixes nor new features into FPC trunk. Political decision and revenge of one person in core team...
Anyway still nothing wrong with using FPC trunk instead of NewPascal - individual decision .
Both ways are good. Additional advantage of NewPascal is close cooperation with mORMot, so every change in critical parts of NewPascal (RTL, low level details) are handled in mORMot immediately. FPC trunk is also supported but in some situations update for mORMot may be delayed (and mix of FPC trunk and mORMot may be nonfunctional/full of bugs for some time).
Also NewPascal contains additional patches, bugfixes and features. For example "default field" feature or SmartPointers/ARC objects can be used only with NewPascal. I have also plan of special module dedicated for mORMot for extra features of NewPascal.
mORMot is freedom of choice
Probably you need latest Zeos (I am not sure here), you can download proper/newest version of Zeos here : https://github.com/newpascal-ccr/zeos
Zeos will be part of next release of NewPascal like mORMot .
If you decide to use option 1 then mORMot is ready to use as part of newpascal.zip archive (is located in ccr\mORMot directory) and is detected "out of box" in IDE (you even don't need to configure a project).
If you decide to use option 2 then you need additional step: you can download mORMot via fpcupdelux or you can do download on your own (for example from : https://github.com/synopse/mORMot )
Probably good idea You can do update in 2 ways :
1. http://newpascal.org/download.html / https://github.com/newpascal/newpascal/ … np-v1.0.55
2. via fpcupdelux
Did you try to use in modules :
{$MODE DELPHI}
{$CODEPAGE UTF8}
?
Rather no. InitCSV don't decode, encoded string by ToTextPairs with twJSONEscape option (there is no way to use in proper way InitCSV when twJSONEscape was used in ToTextPairs).
Hi,
seems that we have small problem. The data which is saved by :
SomeVar.test := 'test';
LIni := TDocVariantData(SomeVar).ToTextPairs;
and after is loaded:
TDocVariantData(SomeVar).InitCSV(LIni);
WriteLn(SomeVar.test) // print "test"
LIni := TDocVariantData(SomeVar).ToTextPairs;
TDocVariantData(SomeVar).InitCSV(LIni);
WriteLn(SomeVar.test) // print "\"test\""
works improper (the documentation says : the supplied content may have been generated by ToTextPairs() method). The SomeVar.test contains improper string (encoded JSON string).
The partial solution is:
LIni := TDocVariantData(SomeVar).ToTextPairs('=', #13#10, twNone);
but this is not the point. Probably some additional parameter for InitCSV is needed.
the reality is not perfect and usage of JSON is not always possible. Personally I like the idea of :
https://www.npmjs.com/package/xml-js
some ideas from xml-js may be used in mORMot.
This is a FPC zlib bug...
maybe is worth to report this on FPC mantis bug tracker?
Thanks, for improved/faster implementation. I think that TObjectVariant is better name . The description "lazy-loading to object properties from Variant" is perfect description of my intention.
TObjProxyVariant is here because ObjectToVariant not work for all cases. It is not art for the art but comes from practice and is widely used in my projects. Sometimes "pre generated" Variant form object is not best choice.
thanks TObjProxyVariant can be optimized a lot : by caching TSQLPropInfoRTTI and by TSynDictionary for fast lookup for property names. Anyway current implementation is fast enough for me.
Hi,
I almost forgot about my new small feature already implemented some time ago : TObjProxyVariant
https://github.com/synopse/mORMot/pull/79
TObjProxyVariant is a custom variant type used to have direct access to object published properties. Very usable for cases where conversion from object to variant is not sufficient. TObjProxyVariant provides direct access to object properties from Variant instead of conversion to Variant. Example usage with mustache:
{$MODE DELPHI}
{$APPTYPE CONSOLE}
uses
mORMot, SynMustache;
type
TA = class
private
fi: integer;
function GetR: Integer;
published
property r: Integer read GetR;
property i: integer read fi write fi;
end;
TB = class
protected
fa: TA;
public
constructor Create;
destructor Destroy; override;
published
property a: TA read fa;
end;
function TA.GetR: Integer;
begin
Result := Random(100);
end;
constructor TB.Create;
begin
fa := TA.Create;
end;
destructor TB.Destroy;
begin
fa.Free;
end;
var
b: TB;
v: variant;
begin
b := TB.Create;
TObjProxyVariant.New(v, b);
v.a.i := 10;
WriteLn(TSynMustache.Parse('{{a.r}}/{{a.i}}/{{a.r}}/{{a.i}}/{{a.r}}').Render(v));
b.Free;
readln;
end.
example output :
54/10/59/10/71
@ab seems that open array behave in different way than dynamic array
procedure TestMe(const Key: TArray<Byte>);
works as expected.
@ab github release don't need to be related to stable release. I was thinking about github releases as of kind of storage for our all binaries. For example fpcupdelux has following "binary" releases not related (at all) to fpcupdelux source code:
Libraries for cross-compiling v1.1 : https://github.com/newpascal/fpcupdelux … slibs_v1.1
Darwin i386 binary toolchains for cross-compiling: https://github.com/newpascal/fpcupdelux … sbins_v1.0
GIT for Windows: https://github.com/newpascal/fpcupdelux … Git-2.13.2
GDB 7.11.1 for Windows: https://github.com/newpascal/fpcupdelux … gdb-7.11.1
etc.
we could do the same thing for mORMot for related libraries/object files
IMO mORMot for github should use "releases" (like fpcupdeluxe and newpascal does - https://github.com/newpascal/fpcupdeluxe/tags, https://github.com/newpascal/newpascal/releases ).
also is possible to use different categories for releases (by tags) for example sqlite_object_files, js_libraries.
Releases - very good way to keep all binary files around git repository:
I forgot to add Init/Done in example but SIGSEGV of course still occurs.
Hi,
current implementation of TSynLocker is nonfunctional/buggy for pointers. Simple example will raise SIGSEGV
uses
SynCommons;
var
Locker: TSynLocker;
begin
Locker.Init;
Locker.LockedPointer[0] := Pointer(1);
Locker.Done;
end.
bug is very simple to fix:
https://github.com/synopse/mORMot/pull/49
I wonder why my pull request is still not accepted...
What is strange - it works for few calls. I have error only for i = 2 or for i = 3 (it depends on TSQLRecord)... SQLite is used as external database because I need to use ISQLDBRows.
Hi,
maybe I miss something but for simple code like:
FModel := TSQLModel.Create([TExampleData]);
FServer := TSQLRestServerDB.Create(FModel, ':memory:');
FServer.CreateMissingTables;
FProp := TSQLDBSQLite3ConnectionProperties.Create(FServer.DB);
for I := 0 to 3 do
with FProp.Execute('select count(*) from ExampleData', []) do
begin
if Step(true) then
WriteLn(ColumnInt(0));
end;
I got error: "TSQLDBSQLite3Statement.Step(SeekFirst=true) not implemented for simple". Any ideas?
The mORMot acquisition by Embarcadero would be the worst event on my whole life.
Generally ORM systems are known as slow solutions but mORMot is fast so... maybe new namespace FastORM for ORM related stuff? I like dotted namespaces. So for me for example FastORM.Commons would be best . Anyway most important for me is separation to packages whatever the name is.
ab, did you forgot about our initial list of packages?
mORMot_Commons, mORMot_SQLite3 (+ mORMot_SQLite3Static), mORMot_DB, mORMot_REST, mORMot_DDD, mORMot_MVC, mORMot_PDF, mORMot_UI, mORMot_CrossPlatform, mORMot_ZEOS
Hi,
current helpers without parameters are a little problematic:
{{NewGUID}}
will not work. we have workaround (additional fake parameter) which is not intuitive:
{{NewGUID call}}
I have small patch (parameter less helper is searched after context searching):
https://github.com/synopse/mORMot/pull/45
anyway maybe some other syntax for "parameter less" helpers may be better.
AOG (thanks!) found the problem (I can confirm):
https://synopse.info/forum/viewtopic.ph … 311#p24311
we need to find another fix for:
https://synopse.info/forum/viewtopic.php?id=3126
my newest pull request:
Hi,
Is that possible that we have badly implemented threads in mORMot (especially for THttpApiServer.Destroy/TSynThreadPoolTHttpServer.Task)? The problem is really frustrating for me (finally mORMot is state of perfection). All which we have about problems:
https://synopse.info/forum/viewtopic.ph … 301#p24301
https://synopse.info/forum/viewtopic.php?id=3126
https://bugs.freepascal.org/view.php?id=29470
https://bugs.freepascal.org/view.php?id=31987
The problem was partially solved by this modification:
https://github.com/synopse/mORMot/blob/ … 5003-L5006
But still we have problems on shutting down TestSQL3 for FPC :\ (https://synopse.info/forum/viewtopic.ph … 301#p24301)
note: my report on FPC mantis (#31987 - https://bugs.freepascal.org/view.php?id=31987) may be improper :\.
Hi,
I am working with TCP a little and during usage of mORMot (TDDDSocketThread exactly) I discovered the problem:
mORMot can't detect FIN flag (which means end of connection). May be worth to rethink implementation of SynCrtSock.InputSock. Some tip from stackoverflow:
http://stackoverflow.com/a/17705579/278086
I am unable to detect from TDDDSocketThread level packet with FIN flag (from client side). After FIN action (37) my server/client tries to send new packet (39) which is rejected (40) and data are lost. In this step (40) is executed TDDDSocketThread.InternalExecuteDisconnect which is not correct at all. The connection should be closed probably in step after FIN (38) - I guess: packet with ACK and FIN.
After many months of tracking logs from production server (~ 2 millions of http calls to server with SynLZ compression's per month from around ~10 devices), probably I discovered the reason of bug. Since in production environment I have less count of Samsung Galaxy Tab (IIRC Galaxy Tab 3 which has Exynos chipset) the bug occurs less often. All detected anomalies comes only from Samsung devices. From other device like "MyPhone hammer" (which has for sure different ARM processor model) I don't have problems with compression. The most important info about "impossible bug":
http://www.mono-project.com/news/2016/0 … 64-icache/
https://www.theregister.co.uk/2016/09/1 … e_gcc_bug/
ab, did you think that above problem could have influence on SynLZ compression for ARM?
Finally works as expected . Btw. amazing experience: VPS server with own blog/small site with https without any "apache". Just Debian + FPC mORMot application + nginx on the front.
Did we have any plans to support HTTPS via SynOpenSSL in near future? If yes then probably will be possible to drop nginx (maybe not at all if someone needs load balancing)!
Nice trick with /json, thanks . I think that we have problem in framework. "AuthorRights" works correctly only for FPC, Delphi (in my case XE2) shows
"AuthorRights":15,
instead of
"AuthorRights": {
"Comment": true,
"Post": true,
"Delete": true,
"Administrate": true
}
ArticleView is still buggy in Delphi.
I am not sure but probable we have regression for MVC demo
hmm. Seems that sample "30 - MVC Server" is broken for long time ("Add Comment" functionality is not displayed). Tested with latest mORMot on Delphi and FPC, also very old mORMot (I use for test purposes old version from 2015 January) is broken so this bug is not new :\ ...
Hi,
I am not sure but probable we have regression for MVC demo. The problem is visible for logged user (in this case synopse). Seems that Mustache won't work anymore for sets (like in ArticleView.html):
{{#main.session.AuthorRights.canComment}}
In case of "ArticleView.html view" the logged user can't comment articles anymore. Could someone confirm that?
I suppose that we have no plans to go for ARC Delphi compiler for Linux (which is only for Enterprise+ editions even for RAD Studio ... ).
@vonH
The trunk changes can be found here: http://wiki.freepascal.org/User_Changes_Trunk
I leave it to hnb to explain more about NewPascal, but in general, NewPascal is a very recent trunk without the dangers of trunk.
as AOG said: NewPascal is a very recent trunk without the dangers of trunk (for mORMot)
NewPascal is compatible with FPC trunk, but not vice versa (for some time).
Many things has changed. We have unexpected and positive effect of NewPascal - I've started close cooperation with FPC core team and finally many areas (critical for mORMot) are improved. Current list of differences between NewPascal and FPC: http://newpascal.org/compass.html
Very short list in section "NewPascal individual changes" may be expanded in the future. Each item in "NewPascal individual changes" should be merged with FPC trunk (sooner or later). Some time ago "NewPascal individual changes" list was much, much longer.
Please note that http://wiki.freepascal.org/User_Changes_Trunk is not yet updated (no info about newest RTTI changes and management operators - http://free-pascal-general.1045716.n5.n … 7716.html)
so if I understand correctly, even with those workarounds in place using fpc 3.0.2 and mORMot trunk is something you're advising against .
Am I correct ?
Yes. I can't wait for next FPC release (probably 3.2 or 4.0) which will be full of required features. 3.0.2 is too weak for mORMot and has only minor bugfixes (in comparison to 3.0.0).
Please note that even FPC pure trunk is bad choice because we have in plans to improve RTTI on many levels so you can't be sure which version of mORMot works correctly with yours FPC trunk. Only NewPascal contains tested mORMot with selected FPC trunk revision. NewPascal is safe buffer and meeting point between FPC and mORMot
AFAIU, ab's regression test suite is something that we can rely on and currently at least for the windows platform it reports full pass for i386 and nearly perfect ( 1 test failed ) for x86_64 . I don't understand your comment regarding "FPC is not fully functionally" if i take into account these results. Could you plz elaborate ?
It's simple: we have some DEFINE's (for example "HASINTERFACERTTI" for interfaces RTTI) which are available only in trunk/NewPascal. AFAIK when you run tests and HASINTERFACERTTI is missing mORMot has nice workarounds for missing features (some pre-generated data - see TestSQL3FPCInterfaces) but this is not the same (!). Remember that not all is covered by test (for example trunk/NewPascal has improved properties behaviors, more Delphi compatible RTTI (not in binary format, I mean here functionality), RTL, syntax and much more).
PS: Congrats for free pascal svn write access .
Thanks but this is only thanks to mORMot (mORMot is great inspiration and motivation for my work). That would be impossible without ab, AOG and mORMot.