#1 Re: mORMot 2 » Using TCollection inTOrm » 2023-05-28 11:11:53

AOG

By the way, I like the idea of embedding detail data within the record (sharding). Would be interesting to know what other people use, just schemaless TDocVariant?

I mostly (always) use sharding, together with json storage. Keeps the raw database data in a format that also can be read by other applications not based on the mORMot.

#2 mORMot 2 » Using mORMot without static libs » 2023-04-09 10:30:15

AOG
Replies: 1

Hello Ab,
Due to the de-coupling of features in mORMot2, it can be used for more than only database [ORM] stuff.
On- and offline, I am advising people to consider using mORMot2 for their tasks.
However, the use of static libs and the linking of these libs is something that always leads to errors about missing libs.
I know, RTFM, but anyhow.
To give an example.
The chat-client and -server examples (on Windows) need libkernel32 and libdeflatepas.
Would it be possible to have a soft-version of the mORMot2 that does not need these libs and compiles and runs out-of-the-box.
(e.g. from a simple Github clone)
Thanks for taking the time.

#3 Re: mORMot 1 » mORMot 2 Release » 2022-06-11 08:59:33

AOG

Thank you very much for sharing !! Much appreciated. Will have a very close look.

#4 Re: mORMot 1 » mORMot 2 Release » 2022-06-09 20:56:17

AOG

@trx
If you are willing to share your efforts, I would be very pleased.

#5 Re: mORMot 1 » mORMot 2 Release » 2022-06-08 07:13:15

AOG

The ddd folder is still empty ... ;-)

#6 Re: mORMot 1 » Building/running for Apple Silicon M1 (aarch64-darwin) » 2022-04-20 05:08:47

AOG

was built for newer macOS version (11.0) than being linked (10.8)

Please have a look at your fpc.cfg. Fpcupdeluxe might have added a -WM define (somewhere at the bottom of the cfg). You might try to remove it and build the mORMot again. I do not know if it will improve anything, but its worth the try.

#7 Re: mORMot 1 » mORMot2 on ARM » 2022-04-19 05:12:21

AOG

but the lists of FPC and Lazarus version numbers are invisible or incompletely populated

This is probably due to the fact that fpcupdeluxe is not able to create some initial settings files. Create a folder somewhere (desktop) and please move fpcupdeluxe to this directory of your choice. The same is needed on Apple (when fpcupdeluxe is run from the Download folder).

#8 Re: mORMot 1 » THttpClientSocket with Basic authentication returns empty content » 2022-03-30 07:56:15

AOG

Just for your info. The bug-report related to this FPC 3.2.2 issue. Conclusion: FPC 3.2.2 is not suited for the mORMot[2] due to this bugger.
https://gitlab.com/freepascal.org/fpc/s … sues/39438

#9 Re: mORMot 1 » THttpClientSocket with Basic authentication returns empty content » 2022-03-29 12:48:04

AOG

Ok. Thanks.
Problem reproduced. Its FPC 3.2.2 itself, so current stable gives this error. FPC 3.2.3 (as per fixes on your laptop) gives all greens.

#10 Re: mORMot 1 » THttpClientSocket with Basic authentication returns empty content » 2022-03-29 12:16:53

AOG

Don't worry. You are not wasting anybody's time.
You gave good info. Except for the manner in which you installed the mORMot2.
So, how did you install mORMot2 ?
With this info, I will try to reproduce your issue.

#11 Re: mORMot 1 » THttpClientSocket with Basic authentication returns empty content » 2022-03-29 09:16:16

AOG

Few minutes ago, I installed FPC fixes with Lazarus fixes through fpcupdeluxe on a win11 pc.
Also installed latest mORMot2 sources with fpcupdeluxe.
Result: all greens on win32 mormot2tests !

#12 Re: mORMot 1 » mORMot2 with FPC Trunk » 2022-02-14 07:34:10

AOG

With FPC trunk and mORMot2 from just a few minutes ago, I cannot reproduce your errors.
All greens on my system: win11, mORMot2 for win32 and win64.

#13 Re: mORMot 1 » mORMot2 on ARM » 2022-02-12 11:25:45

AOG

Your "trick" works !
Thanks.

#14 Re: mORMot 1 » mORMot2 on ARM » 2022-02-12 09:26:27

AOG

Bugger solved.
https://gitlab.com/freepascal.org/fpc/s … 1dfbc523a8

All greens now on Linux AArch64 with FPC trunk. Very good !
However, a small workaround for the FPC source parser was needed.
In function GetJsonField, a label (lit) is used for a goto. This results in code errors on AArch64.
If the label is removed, all is ok and 100% error free mORMot2 can be enjoyed.

#16 Re: mORMot 1 » mORMot2 on ARM » 2022-02-09 13:22:44

AOG

When will you publish the next 2.2.0i release?

Should be within a week. Still waiting for confirmation of some fixes.

#17 Re: mORMot 1 » mORMot2 on ARM » 2022-02-09 13:20:25

AOG

@ab.
Yes, 38018 is supported by your commit ! Its not a mORMot2 problem.
However, as stated, this is a FPC problem. It seems that the calculation of the header size in the compiler sources is not correct for aarch64.
Lazarus trunk crashes within few minutes. Its memory consumption goes up with an MB per second whenever the source editor is used.

#18 Re: mORMot 1 » mORMot2 on ARM » 2022-02-09 12:53:47

AOG

@ab

Is the current fpcupdeluxe able to cross-compile from Linux to Darwin AArch64?

Yes !

#19 Re: mORMot 1 » mORMot2 on ARM » 2022-02-09 12:52:44

AOG

Final Aarch64 Linux FPC trunk update.
This issue: https://gitlab.com/freepascal.org/fpc/s … sues/38018
This commit: https://gitlab.com/freepascal.org/fpc/s … bdd0018f2e
Are the cause of the failures and memory leaks on current FPC trunk.
If I run the mORMot2 on the previous (see below) commit, all greens, no leaks.
Previous: https://gitlab.com/freepascal.org/fpc/s … 84d1432048
So, no mORMot2 issue !

#20 Re: mORMot 1 » mORMot2 on ARM » 2022-02-08 13:00:57

AOG

Update about FPC trunk + mORMot2 on AArch64 (Odroid C2 running Arch Linux).
The memory leak reported by me earlier seems to be caused by FPC. Even Lazarus crashes (and gets killed) due to huge and increasing memory consumption, even when idle.
Will keep you informed.

#21 Re: mORMot 1 » mORMot2 on ARM » 2022-02-05 11:07:16

AOG

@ab
Yes, in theory all should work. That is why I am still looking into the real source of the issues mentioned.
Sidenote:
FPC trunk has
TAnsiRec = {packed} Record
TUnicodeRec = {packed} Record
tdynarray = { packed } Record 
The packed is not used anymore of these records.

#22 Re: mORMot 1 » mORMot2 on ARM » 2022-02-05 10:31:49

AOG

I can confirm the described problem(s) on aarch64. And, I have a hard time debugging the issue(s).
At the moment, most severe problems (on my system) stem from a memory leak on fastsetstring (and derivatives). String-memory is not released, causing a (out-of-memory) system-crash.
Still looking into this. Will report if any news.

#23 Re: mORMot 1 » mORMot2 on ARM » 2022-01-31 10:38:09

AOG

The latest mORMot2 (with sqlite3-statics) with the latest FPC trunk (both today) works very well on ARM32 bit.
Will try ARM64 also, if time permits.

#24 Re: mORMot 1 » test prj compile error on delphi 11 » 2021-11-30 08:18:20

AOG

There ae some more (also runtime) errors on Windows with latest sources.
I am looking into them right now. Nearly all solved. Stay tuned. Will do a pull-request.

#25 Re: Free Pascal Compiler » FPC 3.2.2 Regression for Variant Late Binding - Do Not Use » 2021-11-12 07:24:26

AOG

I have found the cause of this issue. If corrected, all mORMot tests run green !

Its a change in ncal.pas.
FPC 3.2.0 and earlier have: tcb.emit_pchar_const(pchar(methodname),length(methodname),true);
FPC 3.2.2 and newer have: tcb.emit_pchar_const(pchar(methodname),length(methodname)-1,true);

The change is commented by:
            { length-1, because the following names variable *always* starts
              with #0 which will be the terminator for methodname }

If this change is reverted, all test run green on 3.2.3 and trunk.

Greetings, Alf.

#26 Re: Free Pascal Compiler » FPC 3.2.2 Regression for Variant Late Binding - Do Not Use » 2021-11-11 19:34:58

AOG

Just tested with FPC 3.2.3
Same problems still seem to be present unfortunately.

#27 Re: mORMot 1 » mORMot2 fpc linker error » 2021-09-15 08:50:45

AOG

FPC trunk (main) on win32 : no problem.

#28 Re: mORMot 1 » mORMot2 recommended FMX-Client(WS?) » 2021-09-09 07:22:09

AOG

It would be nice if you could share the changes that were needed to get things working again.
Thanks !

#30 Re: mORMot 1 » Oracle OCI ARMv8.2 VM » 2021-08-04 09:31:48

AOG

Nice find. This is good to know ! Lets try to use this "feature" ... smile

#31 Re: mORMot 1 » Oracle OCI ARMv8.2 VM » 2021-08-03 18:38:22

AOG

From the book:

Otherwise, the caller shall reserve a block of memory of sufficient size and alignment to hold the result. The
address of the memory block shall be passed as an additional argument to the function in x8. The callee may
modify the result memory block at any point during the execution of the subroutine (there is no requirement for
the callee to preserve the value stored in x8).

From the assembler:

TEST.SOA.CORE$_$TSERVICECOMPLEXCALCULATOR_$__$$_ECHORECORD$TCONSULTANAV$$TCONSULTANAV:
// [548] begin
	stp	x29,x30,[sp, #-16]!
	mov	x29,sp
// Var $self located in register x0
// Var $result located in register x8

It seems we have to take care of results passed in x8 !

#32 Re: mORMot 1 » Oracle OCI ARMv8.2 VM » 2021-08-03 17:52:05

AOG

As an in-between test, you could add the EchoRecord function into mORMot1.18 and see if it works with that version.
(skip this post if it is already there)

#33 Re: Free Pascal Compiler » mORMot2 (Latest Release) regression test on Win64 failed. Critical? » 2021-07-10 14:46:47

AOG

Well, this isn't the case here. This one works fine.

Please state the system you used to test. I presume you used 64bit FPC trunk of today running on Windows 10 64 bit ?

#34 Re: Free Pascal Compiler » mORMot2 (Latest Release) regression test on Win64 failed. Critical? » 2021-07-10 14:18:28

AOG

You report an error. I did have a look at this error. And tested the mORMot2 with FPC trunk. On my system, the error seems to be related to a particular statement. If the same is valid on your system, you have helped us in isolating this error. And making the bug-hunt and bug-solving a bit easier. If the bug is fixed, the test-suit will run again at 100% greens.

#36 Re: Free Pascal Compiler » mORMot2 (Latest Release) regression test on Win64 failed. Critical? » 2021-07-10 12:03:02

AOG

Compiler FPC 3.0.2

I guess and hope you mean FPC 3.2.0 ?

Crossing from win64 to win32 is very ill advised and not supported by both FPC and mORMot[2].

As I am myself running the mORMot[2] with FPC trunk on various systems, it would be interesting (for me) to see your results when using trunk.

As a sidenote: with trunk I am also experiencing some errors with Core Script at 3.1 ! Its caused by this line (test.core.script.pas):

v := Run('Date() + "=" + new Date().toString()');

If I comment this line (and the accompanying next line), the tests run fine.

#37 Re: mORMot 1 » New Statics for mORMot » 2021-03-30 06:42:15

AOG

And where can I read, what change in fpc was done?

Dunno. Its a FPC compiler error. Hard to isolate. Easy to work around.

#39 Re: mORMot 1 » mORMot 2 in Good Shape » 2021-03-21 12:14:23

AOG

I have compiled some sqlite3 Android libs v3.35.0000
Use them as you see fit. Greetings.
https://github.com/LongDirtyAnimAlf/fpc … 350000.zip

#40 Re: mORMot 1 » mORMot2 examples » 2021-03-07 06:37:02

AOG

Try this:

if not Assigned(OnMatch) or
    (not (Assigned(KeyCompare) or
    Assigned(ValueCompare))) then
  exit;

#41 Re: mORMot 1 » Mqtt server based on mormot's network,give some suggestion pls » 2021-02-07 06:43:05

AOG

Hi songshuang,
Thanks for sharing your code. Looks very interesting and welcome. A mORMot based MQTT server (and client) is very much appreciated (by me) !

#42 Re: mORMot 1 » mORMot 2 in Good Shape » 2021-01-19 09:27:50

AOG

Hi Ab,
At the moment, mORMot2 does not run on arm. It gives a "property has no RTTI"-error. Naturally, this can be solved.
The question however:
Is mORMot2 suitable and mature now to perform deep debugging these errors ? If yes, I will dig into this and start porting my apps towards mORMot2.
Thanks.

#43 Re: mORMot 1 » SQLite as a document database » 2020-12-27 08:45:33

AOG

I would (also) welcome the implementation of sqlite3-json features. Trying to be future-proof, all my complex objects are stored as json in sqlite3. Would be good to have dedicated json-features for speed-reasons.

#44 Re: mORMot 1 » DDD object flattening » 2020-11-15 19:59:40

AOG

Thanks very much. Will look into this. I guess this will serve my needs.

#45 mORMot 1 » DDD object flattening » 2020-11-15 09:22:10

AOG
Replies: 2

Hi Ab,
I have a (feature) request (if needed). My projects now use DDD. For storing product information.

TProduct = class(TSynAutoCreateFields)
  protected
    fProductCode : RawUTF8;
    fDetail      : TDetails;
  published
    property ProductCode  : RawUTF8 read fProductCode write fProductCode;
    property Detail       : TDetails read fDetail;
end;
TDetails = class(TPersistent)
...
end;

The TDetails are flattened by default. But I would like to have them more compact as JSON in the database file.
I succeeded in doing so by disabling the "pilSubClassesFlattening" options in mORMotDDD.pas (and adding an autocreated TDetails-field in the record and with RegisterClassForJSON for TDetails).
Could this be made info an options to flatten by default or not in special cases ? Or can this already be accomplished ?
Thanks.

Edit:
Perhaps an idea: scan the ORM instance for a field with the same signature (and name) as the field in the aggregate itself.

#46 Re: mORMot 1 » mORMot 2.0 status? » 2020-11-06 06:28:26

AOG

Teasing presentations !! Clear explanations also. Looking forward to mORMot2.

#47 Re: mORMot 1 » GraphQL versus REST » 2020-11-01 20:27:55

AOG

Thanks Ab, I have completely overlooked the links you provided.
These provide enough info.
For me, REST is enough. And DDD makes all abstractions worthwile.
The question was based on the fact that Pimcore (a nice PIM) will change its api towards GraphQL. And I am using the mORMot to provide Pimcore some realtime data.

#48 mORMot 1 » GraphQL versus REST » 2020-11-01 11:58:00

AOG
Replies: 2

Hello Ab,
Hello All,

There is an ongoing discussion about GraphQL being better (more efficient) than REST.
I would value the opinions of the mORMot boss and users ?

Thanks, Alfred.

#49 Re: mORMot 1 » TestSQL3.lpi build fails on GNU/Linux x64 » 2020-06-25 19:42:11

AOG

Happy coding and speeding ... :-) ... thanks !

#50 Re: mORMot 1 » TestSQL3.lpi build fails on GNU/Linux x64 » 2020-06-25 18:20:09

AOG

Some (better) improvements might be expected from the advices that are shown here:
https://www.sqlite.org/compile.html

Board footer

Powered by FluxBB