#1 mORMot 2 » AESSHA256 in mORMot 2 » 2024-10-25 18:38:17

Márcio Baroni
Replies: 1

Hello everyone
Could someone help me with what would be the equivalent of "AESSHA256" (mormot1) for mORMot 2?

Thanks

#3 mORMot 2 » Error commit "rtti: explicit size limitation of sets up to ENUM_MAX" » 2024-10-04 17:13:48

Márcio Baroni
Replies: 2

ab, after this commit https://github.com/synopse/mORMot2/comm … 41536310ee

  if Cache.Size = 0 then
    if Kind = rkSet then // mormot.core.rtti/json hardcore getter/setter limit
      ERttiException.RaiseUtf8('ComputeCache(%): sets are limited to % items',
        [RawName, ENUM_MAX])
    else
      ERttiException.RaiseUtf8('ComputeCache(%): has RttiSize=0', [RawName]);

I get the error:

raised exception class ERttiException with message 'ComputeCache(TNotifyEvent): has RttiSize=0'
raised exception class ERttiException with message 'ComputeCache(TOnRestServerCallBack): has RttiSize=0'

Delphi 10.3 Windows 11

#4 Re: mORMot 2 » issue with new IsContentTypeCompressible(pointer(OutContentType)) » 2024-07-26 18:10:52

The problem is in unit mormot.net.http.pas line 2770

 for i := 1 to length(Handled) do 

correct would be

 for i := 0 to length(Handled) do 

#5 Re: mORMot 2 » Where do I start? » 2024-07-04 12:06:39

I've been using Mormot for a long time and it was really difficult at first.
If I can give one piece of advice, don't mix the ORM layer with the API layer.
Create ORM classes just to interact with the database.
Create another layer of classes (DTO) for your api or business rules...
With your DTO you can return whatever you want in your api without any relation to ORM, making it much cleaner.

#6 Re: mORMot 2 » External table BatchSend raises SharedTransaction exception. » 2024-06-04 13:02:47

I have the same problem in the same scenario...
I solved it by changing the function "TSqlDBConnectionProperties.SharedTransaction" em "mormot.db.sql.pas"

diff --git "a/src/db/mormot.db.sql.pas" "b/src/db/mormot.db.sql.pas"
index 27e1c0b5..a239890b 100644
--- "a/src/db/mormot.db.sql.pas"
+++ "b/src/db/mormot.db.sql.pas"
@@ -3721,7 +3721,9 @@ begin
               MoveFast(fSharedTransactions[i + 1], t^, (n - i) * SizeOf(t^));
               SetLength(fSharedTransactions, n);
               found := true;
-            end;
+            end
+            else
+               exit;
           end;
           break;
         end

#7 Re: mORMot 2 » IDocList/IDocDict JSON for Delphi and FPC » 2024-02-02 19:19:12

Congratulations Arnoud
I always had difficulty working with TDocVariant/TDocVariantData
Very good...

#9 Re: mORMot 2 » Embed mab file in exe » 2023-09-05 13:42:18

ab, I'm passing the exe path as a parameter to embed the ".map" in the ".exe"

ex: mab.exe "c:\test.exe"

there is the "test.map" inside the same folder...

this doesn't work anymore, in mormot1 I used it that way.

actually passed the exe path as a parameter, it tries to read the exe as a map.

I made an adjustment on line 3123:

    begin
      ExeFile := ChangeFileExt(ExpandFileName(aExeName), '.exe');
      fDebugFile := ChangeFileExt(ExpandFileName(aExeName), '.map');
    end;

#10 Re: mORMot 2 » Embed mab file in exe » 2023-09-05 12:27:08

ab, I think there is a problem..

at line 3134 GenerateFromMapOrDbg(DebugToConsole); unit mormot.core.log is getting infinite loop
I'm passing the executable path.

1

#11 Re: synopse.info » Forum suggestion - responsive feature for mobile » 2023-03-11 13:09:45

This modification would be great, following the forum by cell phone is very bad.

#13 mORMot 2 » Angelize » 2023-01-19 20:05:43

Márcio Baroni
Replies: 1

AB,
I am following the development of "Angelize" which will fit perfectly in my system.

I know it's not finished yet but I would like to ask if you have any plans to implement:
* run multiple instances of the same service (exe)
* service (exe) update in case of updating to a new version of exe

#15 Re: mORMot 1 » Error after commit "fixed long-standing potential GPF in UpperCopy255" » 2022-04-26 12:23:20

Yes, it is related to the excerpts below:

function TSQLModel.GetTableIndexPtr(SQLTableName: PUTF8Char): integer;
begin
  if (self<>nil) and (SQLTableName<>nil) then begin
    result := FastFindUpperPUTF8CharSorted( // O(log(n)) binary search
      pointer(fSortedTablesNameUpper),fTablesMax,SQLTableName,StrLen(SQLTableName));
    if result>=0 then
      result := fSortedTablesNameIndex[result];
  end else
    result := -1;
end;


function FastFindUpperPUTF8CharSorted(P: PPUTF8CharArray; R: PtrInt;
  Value: PUTF8Char; ValueLen: PtrInt): PtrInt;
var tmp: array[byte] of AnsiChar;
begin
  UpperCopy255Buf(@tmp,Value,ValueLen);
  result := FastFindPUTF8CharSorted(P,R,@tmp);
end;

#16 mORMot 1 » Error after commit "fixed long-standing potential GPF in UpperCopy255" » 2022-04-26 11:48:10

Márcio Baroni
Replies: 5

Hello, after I updated the mORMot sources, I started getting the following error:

EORMBatchException {"Message":"TServidorApp.EngineBatchSend: Unknown @Licencas"}

The table is registered normally:

VirtualTableExternalRegister(fModelo, TSqlLicencas, fBD.Conexao, 'CLIFOR_LICENCAS');
fModelo.Props[TSqlLicencas].ExternalDB.MapField('ID', 'LIC_ID');


Going back to the commit works correctly.
This system has been in production for years.

#17 Re: mORMot 1 » mORMot 2 ORM Performance » 2022-02-15 12:14:36

Great news, I was waiting for the version to be stable to migrate my applications...
Congratulations

#18 Re: mORMot 1 » mormot.core.log - EventArchiveSynLZ bug? » 2021-09-17 12:39:24

I stopped using FastMM5 in my projects, it always gives some weird errors with this one.

#19 mORMot 1 » Adjustment in the log on TSQLDBStatementWithParams.AddParamValueAsText » 2020-07-01 13:20:13

Márcio Baroni
Replies: 1

@ab when SupportsArrayBindings is enabled, the sql instructions in the log do not show the actual data ... so I made an adjustment to the TSQLDBStatementWithParams.AddParamValueAsText function to show the actual values. It may not be the best code.

procedure TSQLDBStatementWithParams.AddParamValueAsText(Param: integer; Dest: TTextWriter;
  MaxCharCount: integer);
begin
  dec(Param);
  if cardinal(Param)>=cardinal(fParamCount) then
    Dest.Add(',')
  else
    with fParams[Param] do
    begin
       if Length(VArray) = 0 then   <<<----
       begin
          case VType of
            ftInt64:    Dest.Add({$ifdef DELPHI5OROLDER}integer{$endif}(VInt64));
            ftDouble:   Dest.AddDouble(unaligned(PDouble(@VInt64)^));
            ftCurrency: Dest.AddCurr64(VInt64);
            ftDate:     Dest.AddDateTime(PDateTime(@VInt64),' ','''');
            ftUTF8:     Dest.AddQuotedStr(pointer(VData),'''',MaxCharCount);
            ftBlob:     Dest.AddU(length(VData));
            else        Dest.AddShort('null');
          end;
       end
       else
          Dest.AddString(VArray[0]);    <<<----
    end;
end;

#20 Re: mORMot 1 » Training sample for lazy dependency injection » 2020-06-17 14:40:47

Register the interface

ServiceDefine (TServiceCalculator, [ICalculator], sicShared);

#21 Re: mORMot 1 » "Samples/15 - External DB performance/PerfTestConsole.dpr" new project » 2020-03-24 17:44:44

Thanks @ab

 2.1. Postgresql:
  - SynDBPostgres: 80,031 assertions passed  2.12s
     5000 insert in 903.66ms i.e. 5,532/s, aver. 180us
     5000 insert batch in 134.05ms i.e. 37,298/s, aver. 26us
     5000 insert trans in 423.24ms i.e. 11,813/s, aver. 84us
     5000 insert batch trans in 53.26ms i.e. 93,866/s, aver. 10us
     5000 read one in 388.92ms i.e. 12,856/s, aver. 77us
     5000 read virtual in 21.99ms i.e. 227,303/s, aver. 4us
     5000 read direct in 10.02ms i.e. 498,902/s, aver. 2us
  Total failed: 0 / 80,031  - Postgresql PASSED  2.13s

 2.2. Zeos postgresql:
  - ZeosPostgres: 80,031 assertions passed  2.67s
     5000 insert in 836.90ms i.e. 5,974/s, aver. 167us
     5000 insert batch in 35.29ms i.e. 141,667/s, aver. 7us
     5000 insert trans in 388.70ms i.e. 12,863/s, aver. 77us
     5000 insert batch trans in 34.84ms i.e. 143,513/s, aver. 6us
     5000 read one in 462.50ms i.e. 10,810/s, aver. 92us
     5000 read virtual in 22.67ms i.e. 220,526/s, aver. 4us
     5000 read direct in 11.39ms i.e. 438,981/s, aver. 2us
  Total failed: 0 / 80,031  - Zeos postgresql PASSED  2.69s

Generated with: Delphi XE5 32 bit compiler

last zeos with USE_SYNCOMMONS active

#22 Re: mORMot 1 » "Samples/15 - External DB performance/PerfTestConsole.dpr" new project » 2020-03-24 16:57:23

@ab, the fossil and github synchronization problem still remains ... not in the commit then github

#24 mORMot 1 » Modification TJSONObjectDecoder.EncodeAsSQLPrepared broke my system » 2020-03-23 14:25:55

Márcio Baroni
Replies: 2

@ab commit https://github.com/synopse/mORMot/commi … b9d01eb74b "small comments / error message enhancement - no functional change"

error: EORMException with message 'Invalid EncodeAsSQLPrepared(1)'

-      if FieldCount=0 then
-        raise EORMException.Create('Invalid EncodeAsSQLPrepared(0)');
+      if FieldCount<2 then
+        raise EORMException.CreateUTF8('Invalid EncodeAsSQLPrepared(%)',[FieldCount]);

it doesn't work with that anymore if you only have 1 column:

   update table set col1 = 'test' where id = 1;

#25 Re: mORMot 1 » SynDBPostgres - implementation of TSQLDB* for Postgres using libpg » 2020-03-20 18:08:41

Running tests using Synopse mORMot framework 1.18.5847, compiled with Delphi XE5 32 bit, against SQLite 3.31.0, at 2020-03-20 15:02:01.

Insertion speed

			Direct	Batch	Trans	Batch Trans
ZEOS PostgreSQL		4459	105540	7334	106571
Postgres PostgreSQL	3938	50373	11503	59945


Read speed

			By one	All Virtual	All Direct
ZEOS PostgreSQL		6660	169629		292431
Postgres PostgreSQL	12767	229042		594883

i5-4440S CPU @ 2.80GHz 4 core 8GB RAM 240GB SSD

#26 mORMot 1 » Access violation on TRawUTF8List.Contains » 2020-03-12 20:23:46

Márcio Baroni
Replies: 1

@ab, I found an Access violation in the Contains function of the TRawUTF8List class

function TRawUTF8List.Contains(const aText: RawUTF8; aFirstIndex: integer): PtrInt;
var i: PtrInt; // use a temp variable to make oldest Delphi happy :(
begin
  result := -1;
  if self<>nil then begin
    fSafe.Lock;
    try
      for i := aFirstIndex to fCount-1 do
        if PosEx(aText,fValue[result])>0 then begin   <<---- the correct would be the variable "i" instead of "result"
          result := i;
          exit;
        end;
    finally
      fSafe.UnLock;
    end;
  end;
end;

#27 Re: mORMot 1 » Patching the examples sources » 2020-02-05 17:43:32

@ab I have noticed several times that some changes made to the fossil are not synchronized with github.

https://pasteboard.co/ITj5s5A.jpg

https://pasteboard.co/ITj5SWo.jpg

#28 Re: mORMot 1 » Error on SynCommons.RetrieveSystemInfo » 2019-12-15 17:41:21

ab, thanks for the fix but the fossil commit was not for github.
The SynCommons.pas file has not been updated on github.

#29 Re: mORMot 1 » Error on SynCommons.RetrieveSystemInfo » 2019-12-12 21:17:13

A possible fix:

var
  buffer: string;
  len: Cardinal;
      ...
      if OpenKeyReadOnly('\Hardware\Description\System') then begin
        if prod='' then begin
          len := GetDataSize('SystemBiosVersion'); //new
          SetLength(buffer, len); //new
          ReadBinaryData('SystemBiosVersion', Pointer(buffer)^, len); //new
          prod := UTF8ToString(Trim(StringReplaceAll(StringToUTF8(buffer), #0, ' '))); //new
        end;
        if prodver='' then begin
          prodver := SysUtils.Trim(ReadString('VideoBiosVersion'));
          i := Pos(#13,prodver);
          if i>0 then // e.g. multilines 'Oracle VM VirtualBox Version 5.2.33'
            SetLength(prodver,i-1);
        end;
      end;
      ....

#30 mORMot 1 » Error on SynCommons.RetrieveSystemInfo » 2019-12-12 17:51:02

Márcio Baroni
Replies: 5

after commit enhanced RetrieveSystemInfo e.g. running from a VM I received a runtime 217

Error:

ERegistryException exception message  : Invalid data type for 'SystemBiosVersion'.

on then line 

prod := SysUtils.Trim(ReadString('SystemBiosVersion'));

The problem is that the key value is multi-line (REG_MULTI_SZ) and the readstring function can't read
this only happens if there is no "SystemProductName" key in the windows registry

#31 Re: mORMot 1 » mORMot and the new full featured Delphi Community Edition » 2018-07-19 11:30:39

Yes...

Windows 10 64bit (10.0.17134) (cp1252)
    4 x Intel(R) Core(TM) i5-4440S CPU @ 2.80GHz (x86)
Using mORMot 1.18.4673
    TSQLite3LibraryStatic 3.24.0 with internal MM
Generated with: Delphi 10.2 Tokyo 32 bit compiler

Time elapsed for all tests: 1m14
Performed 2018-07-19 08:27:58 by xxx on DELL

Total assertions failed for all test suits:  0 / 40,630,183
! All tests passed successfully.

#32 Re: mORMot 1 » git bisect: 4b1ef819c6f1d76801be is the first bad commit » 2017-02-15 13:10:33

Hi, I'm with the same problem ...
I'm turning json to a DataSet to use in a report with ReportBuilder .... but in the last commits this was broken. "JSONToDataSet" from mORMotVCL.pas
I had to switch to "ToClientDataSet" from mORMotMidasVCL.pas to work.

#33 mORMot 1 » Procedure InvalidTextLengthMin » 2016-07-07 13:27:17

Márcio Baroni
Replies: 1

Hello, I found a detail in the procedure "InvalidTextLengthMin" unit"SynCommons.pas" used in the function "TSynValidateText.Process"

original:
procedure InvalidTextLengthMin(min: integer; var result: string);
begin
  result := Format(sInvalidTextLengthMin,[1,Character01n(1)]);
end;

correction:
procedure InvalidTextLengthMin(min: integer; var result: string);
begin
  result := Format(sInvalidTextLengthMin,[min,Character01n(min)]);
end;

thank you

#34 mORMot 1 » ID field in the DTO - Mormot DDD » 2015-10-07 17:07:40

Márcio Baroni
Replies: 4

Hello
I am a beginner in using the framework, studying the use of Mormot (DDD) on my system ...
I wonder how can I use SQLRecord ID field in the DTO objects,
I know that the ID field is an implementation detail, but I need this information in the DTO ...

If anyone can help me, this I thank you ....

Board footer

Powered by FluxBB