You are not logged in.
Pages: 1
Hello everyone
Could someone help me with what would be the equivalent of "AESSHA256" (mormot1) for mORMot 2?
Thanks
Thanks
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
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
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.
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
Congratulations Arnoud
I always had difficulty working with TDocVariant/TDocVariantData
Very good...
thanks
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;
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.
This modification would be great, following the forum by cell phone is very bad.
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
Thanks, working properly.
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;
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.
Great news, I was waiting for the version to be stable to migrate my applications...
Congratulations
I stopped using FastMM5 in my projects, it always gives some weird errors with this one.
@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;
Register the interface
ServiceDefine (TServiceCalculator, [ICalculator], sicShared);
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
@ab, the fossil and github synchronization problem still remains ... not in the commit then github
thanks
@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;
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
@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;
@ab I have noticed several times that some changes made to the fossil are not synchronized with github.
ab, thanks for the fix but the fossil commit was not for github.
The SynCommons.pas file has not been updated on github.
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;
....
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
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.
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.
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
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 ....
Pages: 1