#151 mORMot 1 » String constant truncated to fit STRING[8] » 2021-04-19 05:00:33

sakura
Replies: 1

Hi Arnaud,

the compiler throws a warning [dcc32 Warning] mormot.core.json.pas(4883): W1014 String constant truncated to fit STRING[8]
at TJsonSaveContext.AddDateTime when using

W.AddShorter('T00:00:00Z') // the same pattern for date and dateTime

Regards,
Daniel

#152 Re: mORMot 1 » mOMRot2 test fronzen dead » 2021-04-15 04:17:43

Tested on similar settings, using !0.4.2 though, and all ran through, however, 1 test failed

!  - Mustache renderer: 1 / 157 FAILED  2.05s

Final:

Generated with: Delphi 10.4 Sydney 32 bit compiler

Time elapsed for all tests: 1m42
Performed 2021-04-15 06:16:01 by Daniel Wischnewski on DANIEL-VM

Total assertions failed for all test suits:  1 / 41,661,926
! Some tests FAILED: please correct the code.

#153 Re: mORMot 1 » HandleErrorAsRegularResult missing for ReturnsJson » 2021-03-26 08:24:20

Thanks, perfect :-)

Would you like such changes as pull request, or do you prefer to do them yourself?

#154 mORMot 1 » HandleErrorAsRegularResult missing for ReturnsJson » 2021-03-25 06:54:38

sakura
Replies: 3

Hi,

I'm kind of irritated already, that TRestServerUriContext decides to change my returned content as per default, when I have an error code, however, it really bugs me, that when using ReturnsJson, that there is no option, to suppress that behavior. Why would that be. We have established a pretty specific communication protocol within our system, to send data, states, etc.

Yes, we can convert to JSON every time manually and use Returns with HandleErrorAsRegularResult set to true, but why is it designed to force one to do it that way? Shouldn't the lib, as per standard, treat content returned as-is, rather than changing it in some circumstances?

Would it at least make sense, having an overloaded version of ReturnsJson with the HandleErrorAsRegularResult parameter available?

Regards,
Daniel

#155 Re: mORMot 1 » Sqlite 3.35.0 not found on github » 2021-03-23 08:04:29

Thx, I know, I was just not thinking about it, when the tests came up.

#156 Re: mORMot 1 » Sqlite 3.35.0 not found on github » 2021-03-22 08:31:00

Darn, I did read that topic, but did not connect the dots in my head :-D

#157 Re: mORMot 1 » Value assigned to 'age' never used » 2021-03-22 08:30:00

Thanks, just ensuring it's on purpose :-D

#158 mORMot 1 » Testing published MVC methods » 2021-03-22 08:28:35

sakura
Replies: 1

Hi folks,

rather than just testing services included, I would love to test published MVC methods as well, ensuring correct parameter mapping, and so on.

Considering following minimized MVC app (see https://pastebin.com/xHEUK2vV ), how would my test case look? How would a pass a valid context object?

As much, as I love going through the mORMot tests, I did not find an answer to that :-(

Thanks,
Daniel

#159 mORMot 1 » Sqlite 3.35.0 not found on github » 2021-03-22 07:06:59

sakura
Replies: 6

Hi Arnaud,

running the tests on the curent state, it asked to download the latest release from https://github.com/synopse/mORMot2/rele … ite.3.35.0, however, only up to 3.34.1 is available at this moment.

Thanks,
Daniel

#160 mORMot 1 » Value assigned to 'age' never used » 2021-03-22 05:53:17

sakura
Replies: 2

Hi Arnaud,

another small one,

[dcc32 Hint] mormot.core.zip.pas(1189): H2077 Value assigned to 'age' never used

Regards,
Daniel

#161 mORMot 1 » Combining signed type and unsigned 64-bit type » 2021-03-18 13:50:41

sakura
Replies: 0

Hi Arnaud,

in D10.4.2/Win32 I get following warnings:

[dcc32 Warning] mormot.core.zip.pas(1059): W1073 Combining signed type and unsigned 64-bit type - treated as an unsigned type
[dcc32 Warning] mormot.core.zip.pas(1331): W1073 Combining signed type and unsigned 64-bit type - treated as an unsigned type

I guess a simple cast like

h64.offset := QWord(fDest.Position) - fAppendOffset;
...
lh64.headerOffset := QWord(fDest.Position) - fAppendOffset;

would fix that.

Regards.
Daniel

#162 Re: mORMot 1 » RegisterCustomJSONSerializerFromText and string literal 255 limit » 2021-03-12 07:50:27

ab wrote:

You can use a local variable, I guess.

Or... split the string, it's just a compiler limit

TTextWriter.RegisterCustomJSONSerializerFromText(
TypeInfo(TMyClass), 

'field1, field2, ' + 'field3 RawUTF8'

).Options := [soReadIgnoreUnknownFields];

#163 Re: mORMot 1 » RecordSaveJson raises AV » 2021-03-08 11:35:19

ab wrote:

1. You need to download the latest static from https://github.com/synopse/mORMot2/rele … ite.3.34.1

I thought, I did :-o Only unpacked, but forgot to move...

ab wrote:

2. TExecutable is not serializable for sure.
It was never meant to.
There is an embedded class field - TFileVersion - which prevents JSON Serialization.

My bad, but would have been cool to use directly for mustache ;-)

Thanks,
Daniel

#164 Re: mORMot 1 » RecordSaveJson raises AV » 2021-03-08 09:32:41

ab wrote:

What is Executable?

From mormot.core.os, aka ExeVersion (mORMot 1).

ab wrote:

Do the regression tests pass on your computer?

They, currently, do not even compile (Sorry, forgot to write that in the original post)

[dcc32 Error] mormot.db.raw.sqlite3.static.pas(1089): E2065 Unsatisfied forward or external declaration: 'sqlite3_progress_handler'
[dcc32 Error] mormot.db.raw.sqlite3.static.pas(1094): E2065 Unsatisfied forward or external declaration: 'sqlite3_stmt_scanstatus'
[dcc32 Error] mormot.db.raw.sqlite3.static.pas(1095): E2065 Unsatisfied forward or external declaration: 'sqlite3_stmt_scanstatus_reset'
......
[dcc32 Fatal Error] mormot2tests.dpr(709): F2063 Could not compile used unit 'mormot.db.raw.sqlite3.static.pas'

Regards,
Daniel

#165 mORMot 1 » RecordSaveJson raises AV » 2021-03-08 07:10:29

sakura
Replies: 4

Hi,

can anyone confirm, that a simple console app, only containing

Writeln(RecordSaveJson(Executable, TypeInfo(TExecutable)));

will raise an AV...

Zugriffsverletzung bei Adresse 00000000 in Modul 'IT.exe'. Lesen von Adresse 00000000

( AV at 000000 in module ''. reading address 00000)

mORMot2, current version (GitHub)
Delphi 10.4.2, Win32

Regards,
Daniel

#166 Re: mORMot 1 » mORMot 2 in Good Shape » 2021-02-11 06:20:43

ab wrote:

... but we had to let it win on one algo at least wink

For how long? :-D

#167 Re: mORMot 1 » Rename Asynch to Async (unit name and classes) » 2021-02-04 10:00:07

ab wrote:

Since we don't use "Asynch" as a stand-alone word, it won't break as a potential keyword...

In Delphi it might break, a unit name like mORMot.Core.Const would not work.

Just sayin' ;-)

#168 Re: mORMot 1 » Rename Asynch to Async (unit name and classes) » 2021-02-03 06:58:39

I would leave it at asynch - while you are right - async may just become a keyword at some point, as it is in other languages already, and thus may break compiling, when used in/as unit names ;-)

#169 Re: mORMot 1 » mORMot 2 in Good Shape » 2021-01-26 07:26:38

Thanks @ab, everything works with the current repo on Delphi 10.4 (Win32/Win64) as expected. Millions of perfectly passed tests and zip failed ones. I am impressed, have always been, and likely will always be, with your work and dedication.

#170 Re: mORMot 1 » mORMot 2 in Good Shape » 2021-01-25 06:23:55

So far, looking great. I am using mORMot2 for internal production code (however, basically just the JSON-part), and it is working smoothly. The code created by that is working standalone, as we have to work on XML data, so, no fear of a pre-production version going into production code themselves.

The tests on Delphi 10.4 look promising.

Win32, Release:
Time elapsed for all tests: 56.27s
Total assertions failed for all test suits:  0 / 41,982,561
! All tests passed successfully.

Win64, Release:
Time elapsed for all tests: 45.14s
Total assertions failed for all test suits:  0 / 41,955,145
! All tests passed successfully.

However, when starting, I get a little popup warning:

Static SQLite3 library as included within mormot2tests is outdated!
Linked version is 3.31.0 whereas the current/expected is 3.34.0.
Please download latest SQLite3 3.34.0 revision from
https://github.com/synopse/mORMot2/releases/download/pre1/mormot2static.7z

And I have, just before, updated to the latest version.

Regards,
Daniel

P.S.: Du to user error, I've tested a three day old version, however, the current version performs similar, with the same popup ;-)

#171 Re: mORMot 1 » mORMot 2.0 status? » 2020-09-29 16:17:29

ab wrote:

Little update about mORMot 2 status.

Can't wait :-)

ab wrote:

I just pushed the mormot.orm.core.pas unit, which has the root ORM features.

Cool

ab wrote:

It is uncoupled from TSQLRest, thanks to interfaces use, and should have a better SOLID design.

Sounds great!

ab wrote:

Stay tuned!

I will!

Thanks again!

#172 Re: mORMot 1 » Using StripSemicolon with ODBC Connections » 2020-09-18 09:40:59

Your problem is, that ODBC simply does not support multiple statements in a single command/query. However, if you use MySQL, there is an option, that will enable that special feature.
More on that: https://stackoverflow.com/questions/414 … 6#15440056

Regards,
Daniel

#173 Re: mORMot 1 » [M2] JSON not loading correctly » 2020-09-15 12:51:19

I know, but I thought I might use the JSON already. No production system, but simply exploring it as needed. ;-)

P.S.: And getting used to the namespaces was my target here. :-D I have a compiler switch set to go back and forth. So, as soon as that works, I would be happy to explore more :-P

#174 mORMot 1 » [M2] JSON not loading correctly » 2020-09-15 08:34:39

sakura
Replies: 3

Hi,

I wanted to start working on mORMot2, but got stumped on the first task already. Load JSON into a TDocVariantData record.

  var FileContent := StringFromFile(aFileName);
//  FRoot := TDocVariantData(JSONToVariant(FileContent));
  FRoot.InitJSON(FileContent);

Either way of loading the JSON file (uri: http://fhir.de/StructureDefinition/patient-de-basis/0.2 - there is a JSON representation and at the right/top of the page is a download link for the file) fails without(!) error.
However, the VName and VValue arrays are sized correctly, but contain only empty strings/Unassigned values throughout.

Same lines in mORMot 1.8 work perfectly fine.

Using Delphi 10.4.1, can anyone reproduce on other Delphi versions and/or FPC?

Regards,
Daniel

P.S.: Direct link to JSON file: https://simplifier.net/basisprofilde/pa … ormat=json

#175 Re: mORMot 1 » Problem mORMotMVC with Delphi 10.4 » 2020-09-03 07:27:31

ab wrote:

Don't use Delphi 10.4 but the 10.4.1 branch. big_smile

I'd say wait for 10.5 (or 10.5.1?) - Anyways, 10.4.1 is way better than 10.4, but as far as I had time to play around, I'd still wait. 10.4 changed so many things - usually for the better - but they all still need to learn to play nicely with each other.

#176 Re: mORMot 1 » mORMot 2.0 status? » 2020-08-27 06:05:48

Junior/RO wrote:

There are a branch mORMot2 in Github.

I suppose you've heard my forehead bump onto the table... :-D

Thx

#177 Re: mORMot 1 » mORMot 2.0 status? » 2020-08-26 14:48:50

Is there an "early" access to it?

#178 mORMot 1 » GCM Encryption » 2020-08-06 09:17:21

sakura
Replies: 2

Hi,

are there plans for the SynCrypt module to support GCM (Galois/Counter Mode) encryption, like AES-GCM) at some point?

Thanks for any information,
Daniel

#180 Re: mORMot 1 » Problem mORMotMVC with Delphi 10.4 » 2020-07-20 08:44:04

Perfekt and thanks for the flowers - see you in Düsseldorf in November, I hope :-)

#181 Re: mORMot 1 » Problem mORMotMVC with Delphi 10.4 » 2020-07-20 08:12:07

Well, I compiled our project and I get a perfect result now, in Delphi 10.4

Hints: 0
Warnings: 0
Errors: what's that ;-)

#182 Re: mORMot 1 » Problem mORMotMVC with Delphi 10.4 » 2020-07-20 05:41:51

I have opened up that bug for discussion at the Delphi-PRAXiS as well, hoping to get some traction: https://en.delphipraxis.net/topic/3155- … elphi-104/

As for your question, whether any hints are left, yes one, at first glance looking alike, but this time, I believe it to be correct.

In mORMotService.pas, method    function TService.GetControlHandler: TServiceControlHandler; (line 1143)

It says
[dcc32 Hint] mORMotService.pas(1170): H2077 Value assigned to 'TService.GetControlHandler' never used

However, you have a non-conditional EXIT in line 1154, so the code after that shall never be reached.

Please review ;-)

P.S.: Last, but not least, with the latest changes to mORMot, it works fine under Delphi 10.4 :-) As we are currently just developing, with a release years ahead, I feel okay continuing to use 10.4 ;-)

#184 Re: mORMot 1 » Problem mORMotMVC with Delphi 10.4 » 2020-07-19 13:33:06

Nope, problem still exists. However, a nicer fix for your particular problem exists as well.

Replace the very first else with a semicolon --->

  if (self=nil) or (Dest=nil) then begin
    Result := nil;
    Exit;
  end else
  if (Source<>nil) and (SourceChars>0) then begin
...

change to

  if (self=nil) or (Dest=nil) then begin
    Result := nil;
    Exit;
  end;
  if (Source<>nil) and (SourceChars>0) then begin
...

And the problem is gone as well. I am trying to minimize the problem and will submit that to the team on Monday.

Regards,
Daniel

#185 Re: mORMot 1 » Problem mORMotMVC with Delphi 10.4 » 2020-07-17 17:18:10

ab wrote:

Buggy Delphi compiler... sad

Yeah, not expected, but sh*t happens.

Will do later. :-)

ab wrote:

No other compiler hint reported? There are several other identical patterns in the code. Perhaps the "goto" in this method made the compiler especially unhappy.

Will check, don't think so. A few came from the sample itself.

ab wrote:

Thanks a lot for the investigation!

Helps me too. ;-)

ab wrote:

Perhaps worth a QC report to Embarcadero.

Definitely. Will try to simplify and do just that.

Have a nice weekend,
Daniel

#186 Re: mORMot 1 » Problem mORMotMVC with Delphi 10.4 » 2020-07-17 13:26:05

P.S.: Quick Fix - but not compatible with older compilers like Delphi 7:

Exit(Dest);

Replace that line with roll

#187 Re: mORMot 1 » Problem mORMotMVC with Delphi 10.4 » 2020-07-17 13:23:28

I have located the problem, and it seems to be a compiler/linker problem of Delphi.

When compiling all, we get a hint:
[dcc32 Hint] SynCommons.pas(17526): H2077 Value assigned to 'TSynAnsiFixedWidth.AnsiBufferToUTF8' never used
Which is the line

  Result := Dest; 

and it get's removed by compiler/linker output mad

I will try - at a later point this weekend or Monday- to get the compiler to simply love the line. That should resolve the problem.

#188 Re: mORMot 1 » Problem mORMotMVC with Delphi 10.4 » 2020-07-17 11:53:45

@ab - I cannot confirm 1.18.6078 working.

I have tried back to version 1.18.5749 and the problem persists. It seems to have to do with the SynCommons.MoveX87 method.

Log from the revision: https://pastebin.com/hWC7d3Lc

#189 Re: mORMot 1 » Problem mORMotMVC with Delphi 10.4 » 2020-07-17 08:53:07

@ab - any idea what we could try to solve this problem? Would you like remote access to a 10.4 instance?

Regards,
Daniel

P.S.: Personally, I can wait to see you @EKON24 in November :-D

#190 Re: mORMot 1 » Problem mORMotMVC with Delphi 10.4 » 2020-07-15 09:50:55

So, I had the time to at least get logging into the MVC demo with 10.4
After building a RELEASE version of it and starting it, it crashes on TInterfaceFactory.Create.

The log can be found at https://pastebin.com/ZxtCTe7m

Currently, I am a bit flabbergasted as to why that happens though.

@Arnaud, as written in the Email, you may get remote access to a VM with Delphi 10.4 and that demo to fiddle arround.

Regards,
Daniel

#191 Re: mORMot 1 » 10.4 sydney issues » 2020-06-10 08:24:09

Have you updated https://synopse.info/files/sqlite3obj.7z yet, as the file stamps are from January and the compiled app complains, that versions do not match (Delphi 10.4).

#192 Re: mORMot 1 » Fast MM5 » 2020-05-05 16:08:38

johnnysynop wrote:

...I can confirm urhen comment make sense, total bullshit supporting 20 years old product...

While not my choice of words, it matches my sentiments ;-)

#193 Re: mORMot 1 » Pull requests #303, #304 » 2020-04-12 18:00:11

Eugene Ilyin wrote:

Hi sakura,

Seems like HTTP 402 is reserved as per FRC 7231:

6.5.2.  402 Payment Required

   The 402 (Payment Required) status code is reserved for future use.

Interesting, I had found another definition before, just can't find it again :-( But I guess, that's the better one.

#194 Re: mORMot 1 » Memory Leak, when Rest Server Create with DB » 2020-04-09 05:48:04

macfly wrote:

Just one more option, if the model will not be shared, you leave the TSQLRestServerDB as Owner, so when destroying the TSQLRestServerDB, the Model is also destroyed.

As written before, this was a sample, boiled down to minimal code. Interestingly, the same mistake happened in the sample, as in the real app. However, in the sample it was way more obvious.

#195 Re: mORMot 1 » Memory Leak, when Rest Server Create with DB » 2020-04-08 19:57:34

Ouch, should have seen that myself. Thanks!!!!!

#196 mORMot 1 » Memory Leak, when Rest Server Create with DB » 2020-04-08 17:35:06

sakura
Replies: 4

Hi,

last post was a side effect of my actual problem. I have a memory leak (Delphi 10.3.3), and finally, I have reproduced it with minimal code.

program mORMot.bug;

{$APPTYPE CONSOLE}

{$R *.res}

uses
//  FastMM4,
  System.SysUtils,
  mORMot,
  mORMotDDD,
  mORMotSQLite3,
  SynCommons,
  SynSQLite3,
  SynSQLite3Static;

type
  TSQLTest = class(TSQLRecord)
  private
    FPassword: RawUTF8;
    FLogin: RawUTF8;
    FSalt: RawUTF8;
  published
    property Login: RawUTF8 read FLogin write FLogin;
    property Password: RawUTF8 read FPassword write FPassword;
    property Salt: RawUTF8 read FSalt write FSalt;
  end;

var
  Model: TSQLModel;
  DB: TSQLDatabase;
  Rest: TSQLRestServerDB;
  Test: TSQLTest;
  Success: Boolean;
begin
  ReportMemoryLeaksOnShutdown := True;

  try
    Model := TSQLModel.Create([TSQLTest]);
    DB := TSQLDatabase.Create('2.db');
    Rest := TSQLRestServerDB.Create(Model, DB);
    Rest.CreateMissingTables;

    Test := TSQLTest.Create();
    try
      Success := Rest.Retrieve('Login = ?', [], ['youOrMe'], Test);

      Writeln('Success: ', Success);
    finally
      Test.Free;
    end;

    DB.Free;
    Rest.Free;
    Model.Free;

  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;

  Write('Done ');
  Readln;
end.

Adding FastMM to the uses, further reproduces the problem from my other current topic.

Memory Leak Report

Unexpected Memory Leak
An unexpected memory leak has occurred. The unexpected small block leaks are:

13 - 20 bytes: Unknown x 31
21 - 28 bytes: Unknown x 90
29 - 36 bytes: Unknown x 1
37 - 44 bytes: Unknown x 15
45 - 52 bytes: Unknown x 2
53 - 60 bytes: Unknown x 28
61 - 68 bytes: Unknown x 12
69 - 76 bytes: Unknown x 4
77 - 84 bytes: Unknown x 2
85 - 92 bytes: Unknown x 6
125 - 132 bytes: Unknown x 1
157 - 172 bytes: Unknown x 5
477 - 524 bytes: Unknown x 1
621 - 668 bytes: Unknown x 2
957 - 1052 bytes: Unknown x 1

The sizes of unexpected leaked medium and large blocks are: 85292, 48172, 4140

Regards,
Daniel

#197 Re: mORMot 1 » Access Violation (FastMM4 recorded) » 2020-04-08 17:10:50

Actually, even simpler, is enough to get FastMM4 to blow up:

program mORMot.bug;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  FastMM4,
  System.SysUtils,
  mORMot,
  mORMotDDD,
  mORMotSQLite3,
  SynCommons,
  SynSQLite3Static;

var
  Model: TSQLModel;
  Rest: TSQLRestServerDB;
begin
  ReportMemoryLeaksOnShutdown := True;

  try
    Model := TSQLModel.Create([]);
    Rest := TSQLRestServerDB.Create(Model, '1.db');

    Rest.Free;
    Model.Free;
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;

  Write('Done ');
  Readln;
end.

#198 mORMot 1 » Access Violation (FastMM4 recorded) » 2020-04-08 17:03:48

sakura
Replies: 2

Hi,

not sure how easy it is to reproduce, but with the current release (GitHub), following code will, when run in the debugger, produce an error, shown by FastMM4, at the end of the process.

Delphi 10.3.3

program mORMot.bug;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  FastMM4,
  System.SysUtils,
  mORMot,
  mORMotDDD,
  mORMotSQLite3,
  SynCommons,
  SynSQLite3Static;

type
  TSQLTest = class(TSQLRecord)
  private
    FPassword: RawUTF8;
    FLogin: RawUTF8;
    FSalt: RawUTF8;
  published
    property Login: RawUTF8 read FLogin write FLogin;
    property Password: RawUTF8 read FPassword write FPassword;
    property Salt: RawUTF8 read FSalt write FSalt;
  end;

var
  Model: TSQLModel;
  Rest: TSQLRestServerDB;
  Test: TSQLTest;
  Success: Boolean;
begin
  ReportMemoryLeaksOnShutdown := True;

  try
    Model := TSQLModel.Create([TSQLTest]);
    Rest := TSQLRestServerDB.Create(Model, 'test.db');
    Rest.CreateMissingTables;

    Test := TSQLTest.Create();
    try
      Success := Rest.Retrieve('Login = ?', [], ['youOrMe'], Test);

      Writeln('Success: ', Success);
    finally
      Test.Free;
    end;

    Rest.Free;
    Model.Free;

  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;

  Write('Done ');
  Readln;
end.
---------------------------
Debugger Exception Notification
---------------------------
Project mORMot.bug.exe raised exception class $C0000005 with message 'access violation at 0x01539099: read of address 0x767d75db'.
---------------------------
Break   Continue   Help   
---------------------------

Regards,
Daniel

#199 Re: mORMot 1 » THttpApiWebSocketServer - Free does not return » 2020-03-11 17:35:41

Thanks, first tests look very promising. Tried about 20 times, all worked just perfectly fine :-)

#200 Re: mORMot 1 » THttpApiWebSocketServer - Free does not return » 2020-03-11 15:33:28

destructor THttpApiServer.Destroy;
{$ifdef LVCL}
var i: integer;
{$endif}
begin
  {$ifdef LVCL}
  Terminate; // for Execute to be notified about end of process
  {$endif}
  try
    if (fClones<>nil) and (Http.Module<>0) then // fClones=nil for clone threads

----------- fClones<>nil needed? removing that, it seems to work...

      DestroyMainThread;
    {$ifdef LVCL}
    for i := 1 to 500 do
      if fExecuteFinished then
        break else
        SleepHiRes(10);
    {$endif}
  finally
    inherited Destroy;
  end;
end;

See comment above. I have not seen - in my demo case - where fClones is accessed within DestroyMainThread, so, it being NIL wouldn't be a problem. But in other cases it might...

Board footer

Powered by FluxBB