You are not logged in.
Thanks!
You are right, explicit conversation is required. (Perhaps change something in D11). And sorry for take yours time.
Strings are not simple.
Csaba
Seems to in string from RawByteString (string := RawByteString) conversation lost data on function result after quit function.
If I use RawByteString on full call chain, result is back.
What is the best/safe conversation RawByteString to String?
Hi
I using mormot 2 and before couple of months is no problem.
Base64ToBin conversion is success, but no return value.
Csaba
Hi AB!
My code not working (a couple months ago there was no problem)
function Base64ToBin(const s: RawByteString): RawByteString;
begin
Base64ToBinSafe(pointer(s), length(s), result);
end;
The result variable is ok inside above code, but when I use this function, the return value is empty string.
token := Base64ToBin(aToken);
Delphi 11, latest ORM
Thanks, Csaba
Nice catch, bingo! Error is gone!
Thanks, and sorry for your times!
Run it again with latest (space different):
0000000000000001 ! fail #102 " bar is bar "<>"bar is bar"
Non-false sections have their value at the top of context, accessible as {{.}} or through the parent context. This gives a simple way to display content conditionally if a variable exists.
...
mormot.core.test.pas TSynTestCase.CheckUtf8 (752)
test.core.data.pas TTestCoreProcess.MustacheRenderer (781)
...
Windows 10 64bit (10.0.19043) (cp 1252)
12 x Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (x86)
Using mORMot 2.0.1
TSqlite3LibraryStatic 3.36.0 with internal MM
Generated with: Delphi 11 Alexandria 32 bit Win compiler
Run test with latest version:
Standalone:
0000000000000001 ! fail #102 Non-false sections have their value at the top of context, accessible as {{.}} or through the parent context. This gives a simple way to display content conditionally if a variable exists.
test.core.data.pas TTestCoreProcess.MustacheRenderer (782)
inside Ide + error (maybe this is IDE limitation):
0000000003392DC0 " fail #6944 Rest.Add
test.orm.threads.pas TTestMultiThreadProcessThread.Execute (268)
...
00000000042B4BCB ! fail #6990 Duplicate ID 1687 for thread 44 and 4
test.orm.threads.pas TTestMultiThreadProcess.Test (515)
test.orm.threads.pas TTestMultiThreadProcess.Websockets (593)
Thanks your excellent job!
Test not freeze at all (nor F9, nor Shift-Ctrl-F9, nor debug, nor release).
Error in IDE:
! - Mustache renderer: 1 / 156 FAILED 4.46ms
0000000000000000 ! fail #102 Non-false sections have their value at the top of context, accessible as {{.}} or through the parent context. This gives a simple way to display content conditionally if a variable exists.
and '2.8. Multi thread process' section (couple of line)
0000000004A8F3FA . fail #6923 Rest.Add
...
0000000004BE7C1A ! fail #7051 Duplicate ID 1591 for thread 39 and 2
0000000004D7AD42 ! fail #7052 Duplicate ID 1627 for thread 45 and 2
...
Error in standalon only Mustache.
'Which assertion?'
! - Websockets: 28 / 7,194 FAILED 40.27s
1=3606/s 2=2284/s 5=1009/s 10=449/s 30=150/s 50=35/s
Maybe the first error not able write the ssreen.
In the log I found that:
EHttpServer {Message:"TWebSocketAsyncServerRest.WaitStarted timeout after 30 seconds []"}
[Main] at 84851c mormot.net.server.pas THttpServerSocketGeneric.WaitStarted (1568)
mormot.net.server.pas THttpServerSocketGeneric.WaitStarted (1568)
mormot.rest.http.server.pas TRestHttpServer.Create (731)
test.soa.network.pas TTestBidirectionalRemoteConnection.RunHttpServer (337)
...
Sorry for many code lines.
- Compile OK
- F9: Run to end with assertion error
! - Websockets: 28 / 7,194 FAILED 40.27s
1=3606/s 2=2284/s 5=1009/s 10=449/s 30=150/s 50=35/s
- Sfift-Ctrl-F9: Stop and froze (Ctrl-C to quit), but not assertion error. This is the last line that write:
3.3. Bidirectional remote connection:
- Websockets protocols: 30,000 assertions passed 2.54ms
mormot.net.http missing in uses (test.orm.threads) and pboNoLocalHostEncrypt not found.
In running (without debug Shift-Ctrl-F9) after this point the test program frozen:
3.3. Bidirectional remote connection:
- Websockets protocols: 30,000 assertions passed 3.27ms
When I running it with debug (F9) go to end
2.8. Multi thread process:
- Create thread pool: 1 assertion passed 1.43s
- TRestServerDB: 7,302 assertions passed 452.60ms
1=5722/s 2=24326/s 5=18965/s 10=9805/s 30=9738/s 50=12958/s
- TRestClientDB: 7,301 assertions passed 564.82ms
1=55550/s 2=27072/s 5=3885/s 10=3159/s 30=7907/s 50=5528/s
- TCP sockets: 7,302 assertions passed 16.82s
1=1796/s 2=1303/s 5=758/s 10=441/s 30=151/s 50=86/s
- Windows API: 7,295 assertions passed 4.63s
1=1407/s 2=1873/s 5=3604/s 10=5892/s 30=1568/s 50=1707/s
! - Websockets: 69 / 6,892 FAILED 1m00
1=3374/s 2=2111/s 5=887/s 10=464/s 30=129/s 50=20/s
- Locked: 7,302 assertions passed 651.23ms
1=63224/s 2=7978/s 5=3521/s 10=2549/s 30=6265/s 50=9674/s
- Unlocked: 7,299 assertions passed 265.28ms
1=55106/s 2=57864/s 5=11116/s 10=12996/s 30=9533/s 50=7720/s
- Main thread: 7,301 assertions passed 323.05ms
1=21400/s 2=13071/s 5=12652/s 10=9665/s 30=9987/s 50=7845/s
- Background thread: 7,302 assertions passed 318.27ms
1=7923/s 2=52069/s 5=15599/s 10=20035/s 30=9789/s 50=9435/s
Total failed: 69 / 65,297 - Multi thread process FAILED 1m27
3.3. Bidirectional remote connection:
- Websockets protocols: 30,000 assertions passed 3.32ms
- Run http server: 2 assertions passed 1.40s
- Soa callback on server side: 4,580 assertions passed 623us
- Soa callback via json websockets: 6,898 assertions passed 892.52ms
- Soa callback via binary websockets: 6,898 assertions passed 763.81ms
- Relay start: 4 assertions passed 388.33ms
- Relay soa callback via json websockets: 6,899 assertions passed 2.16s
- Relay connection recreate: 1 assertion passed 164.30ms
- Relay soa callback via binary websockets: 6,899 assertions passed 2.14s
- Relay shutdown: 2 assertions passed 471.50ms
- TRecordVersion: 20,068 assertions passed 311.47ms
Total failed: 0 / 82,251 - Bidirectional remote connection PASSED 9.43s
Delphi 11, Windows 10 32
Thanks AB!
Get latest version now, test run with/without any map file (debug and release)!
UTF8 error gone:
- UTF8: 1,205,931 assertions passed 751.85ms
Only one Mustache error left:
! - Mustache renderer: 1 / 156 FAILED 1.05s
Generated with: Delphi 10.4 Sydney 32 bit compiler
Time elapsed for all tests: 1m01
Performed 2021-04-16 07:18:09 by hollo on MANGALICA
Total assertions failed for all test suits: 1 / 41,646,276
! Some tests FAILED: please correct the code.
Done - Press ENTER to Exit
Fix in latest, one error left on Mustache side:
! - Mustache renderer: 1 / 156 FAILED 1.03ms
But, if not exists map file frozen when test error first ocured.
if map file enabled, not froze, and run to end with error, but success run.
! - UTF8: 14,000 / 1,219,897 FAILED 1.28s
! - Mustache renderer: 2 / 157 FAILED 1.06ms
Generated with: Delphi 10.4 Sydney 32 bit compiler
Time elapsed for all tests: 1m06
Performed 2021-04-15 13:25:45 by hollo on MANGALICA
Total assertions failed for all test suits: 14,002 / 41,657,967
! Some tests FAILED: please correct the code.
Done - Press ENTER to Exit
0000000000000000 ! fail #258 mormot.core.log.pas TSynLog.DebuggerNotify (4670) mormot.core.test.pas TSynTests.DoLog (1073) mormot.core.test.pas TSynTestCase.TestFailed (944) test.core.base.pas Test (4233) test.core.base.pas TTestCoreBase._UTF8 (4425) mormot.core.test.pas TSynTests.Run (1171) mormot.core.test.pas TSynTests.RunAsConsole (1353)
0000000000007302 ! fail #264 mormot.core.log.pas TSynLog.DebuggerNotify (4670) mormot.core.test.pas TSynTests.DoLog (1073) mormot.core.test.pas TSynTestCase.TestFailed (944) test.core.base.pas Test (4233) test.core.base.pas TTestCoreBase._UTF8 (4425) mormot.core.test.pas TSynTests.Run (1171) mormot.core.test.pas TSynTests.RunAsConsole (1353)
0000000000007306 ! fail #270 mormot.core.log.pas TSynLog.DebuggerNotify (4670) mormot.core.test.pas TSynTests.DoLog (1073) mormot.core.test.pas TSynTestCase.TestFailed (944) test.core.base.pas Test (4233) test.core.base.pas TTestCoreBase._UTF8 (4425) mormot.core.test.pas TSynTests.Run (1171) mormot.core.test.pas TSynTests.RunAsConsole (1353)
0000000000007309 ! fail #276 mormot.core.log.pas TSynLog.DebuggerNotify (4670) mormot.core.test.pas TSynTests.DoLog (1073) mormot.core.test.pas TSynTestCase.TestFailed (944) test.core.base.pas Test (4233) test.core.base.pas TTestCoreBase._UTF8 (4425) mormot.core.test.pas TSynTests.Run (1171) mormot.core.test.pas TSynTests.RunAsConsole (1353)
...
000000000013E61B ! fail #1148430 mormot.core.log.pas TSynLog.DebuggerNotify (4670) mormot.core.test.pas TSynTests.DoLog (1073) mormot.core.test.pas TSynTestCase.TestFailed (944) test.core.base.pas Test (4233) test.core.base.pas TTestCoreBase._UTF8 (4429) mormot.core.test.pas TSynTests.Run (1171) mormot.core.test.pas TSynTests.RunAsConsole (1353)
000000000013E64D ! fail #1148436 mormot.core.log.pas TSynLog.DebuggerNotify (4670) mormot.core.test.pas TSynTests.DoLog (1073) mormot.core.test.pas TSynTestCase.TestFailed (944) test.core.base.pas Test (4233) test.core.base.pas TTestCoreBase._UTF8 (4433) mormot.core.test.pas TSynTests.Run (1171) mormot.core.test.pas TSynTests.RunAsConsole (1353)
0000000000235170 ! fail #76 Dotted names should be resolved against former resolutions.mormot.core.log.pas TSynLog.DebuggerNotify (4670) mormot.core.test.pas TSynTests.DoLog (1073) mormot.core.test.pas TSynTestCase.TestFailed (944) test.core.data.pas TTestCoreProcess.MustacheRenderer (686) mormot.core.test.pas TSynTests.Run (1171) mormot.core.test.pas TSynTests.RunAsConsole (1353)
00000000002372F7 ! fail #103 Non-false sections have their value at the top of context, accessible as {{.}} or through the parent context. This gives a simple way to display content conditionally if a variable exists. mormot.core.log.pas TSynLog.DebuggerNotify (4670) mormot.core.test.pas TSynTests.DoLog (1073) mormot.core.test.pas TSynTestCase.TestFailed (944) test.core.data.pas TTestCoreProcess.MustacheRenderer (686) mormot.core.test.pas TSynTests.Run (1171) mormot.core.test.pas TSynTests.RunAsConsole (1353)
In my case: Wondpws 10, Delphi 10.4.2 32bit latest mormot2, also mOMRot2 test fronzen dead
after showing this :Ini files: 7,028 assertions passed 37.51ms
In procmon show only write log file
In log file contain repetead rows:
0000000000000001 ! fail #258 0000000000000101 ! EXCOS EAccessViolation (c0000005) [Main] at 593f1b
0000000000001755 ! EXCOS EAccessViolation (c0000005) [Main] at 593f1b
0000000000002D6E ! EXCOS EAccessViolation (c0000005) [Main] at 593f1b
0000000000004462 ! EXCOS EAccessViolation (c0000005) [Main] at 593f1b
0000000000005B34 ! EXCOS EAccessViolation (c0000005) [Main] at 593f1b
000000000000725D ! EXCOS EAccessViolation (c0000005) [Main] at 593f1b
...
Just for sign, not urgent. Latest version has a compile error. Delphi 10.4.2
mormot.core.variants.pas, ToUtf8(Arguments[0])
[dcc32 Error] mormot.core.variants.pas(3246): E2250 There is no overloaded version of 'ToUtf8' that can be called with these arguments
[dcc32 Error] mormot.core.variants.pas(3252): E2250 There is no overloaded version of 'ToUtf8' that can be called with these arguments
[dcc32 Error] mormot.core.variants.pas(3271): E2250 There is no overloaded version of 'ToUtf8' that can be called with these arguments
[dcc32 Error] mormot.core.variants.pas(3276): E2250 There is no overloaded version of 'ToUtf8' that can be called with these arguments
[dcc32 Error] mormot.core.variants.pas(3297): E2250 There is no overloaded version of 'ToUtf8' that can be called with these arguments
[dcc32 Fatal Error] mormot.core.perf.pas(617): F2063 Could not compile used unit 'mormot.core.variants.pas'
Hello ab! Your product is fantastical (hungarian slang: “nagyon Gromek”). In the new project I use mormot2.
In the new update I not found 3.35.0 static binaries for mormot2. Mormot2 test not run. Are any timeframe for update or just fix the version string in the file?
mormot.db.sqlite3.static.pas:
{$ifdef OSANDROID} '3.34' {$else} '3.35.0' {$endif};
Thx
Many thanks! Great work and support!
Latest build (Delphi 10.3.3): [dcc32 Error] SynCommons.pas(60010): E2125 EXCEPT or FINALLY expected
function TRawUTF8List.IndexOfObject(aObject: TObject): PtrInt;
begin
if (self<>nil) and (fObjects<>nil) then begin
fSafe.Lock;
try
result := PtrUIntScanIndex(pointer(fObjects),fCount,PtrUInt(aObject)) else <---error [dcc32 Error] SynCommons.pas(60010): E2125 EXCEPT or FINALLY expected
result := -1;
finally
fSafe.UnLock;
end;
end;
end;
@pvn0, Of course not. Demo project for 'real time' debug for server communication to and from variable clients.
Many thanks for everybody!
I got a solution, use TTask instead of CriticalSection or Syncronize.
Inside of EchoCustom function:
aTask := TTask.Create(procedure begin Memo1.Lines.Add(Text); end);
aTask.Start;
Result := true;
Sorry ab!
2nd line not in code, copy code accident, but not working without it also.
Which correct way to show log information in gui application?
Read periodically log file? The console echo is perfect, how can i this in forms?
Thanks, Csaba
This part is ok, but i log all event, like consol app.
TSQLLog.Family.EchoToConsole := LOG_VERBOSE;
HTTPServer := TSQLHttpServer.Create(HTTP_PORT,[ORMServer]);
I want in form app: start server and log into all to the memo.
Minimal code:
TfrmRestServer = class(TForm)
Memo1: TMemo;
private
{ Private declarations }
FRestServer:TSQLRestServerFullMemory;
FhttpServer:TSQLHttpServer;
public
{ Public declarations }
function Echo(Sender:TTextWriter; Level:TSynLogInfo; const Text:RawUTF8):boolean;
end;
function TfrmRestServer.Echo(Sender:TTextWriter; Level:TSynLogInfo; const Text:RawUTF8): boolean;
begin
TThread.Synchronize(nil,
procedure
begin
Memo1.Lines.Add(Text);
end
);
Memo1.Lines.Add(Text);
Result := true;
end;
...
TSQLLog.Family.Level := LOG_VERBOSE;
TSQLLog.Family.NoFile := True;
TSQLLog.Family.EchoCustom := frmRestServer.Echo;
FRestServer := TSQLRestServerTest.Create(TSQLModel.Create([]));
FhttpServer := TSQLHttpServer.Create('888', [FRestServer]);
But not work, Write two line, after application is freeze.
Yes, think this is the problem, but I dont find solution.
TThread.Synchronize(nil,
procedure
begin
Memo1.Lines.Add(Text);
end
);
Not working.
Hi,
I have VCL form server application (not console)
When I set TSQLLog.EchoCustom my own log writer then application is freeze.
function TfrmRestServer.Echo(Sender:TTextWriter; Level:TSynLogInfo; const
Text:RawUTF8): boolean;
begin
Memo1.Lines.Add(Text); <- without this line, not freeze
Result := true;
end;
How write log info to main form memo component?
Thanks, Csaba
The problem is ToDataset(), BinaryToDataSet() convert from rawbytestring or ISQLDBRows, not from List and from json.
I use TSQLRestClient. List(), RetrieveList(), because i have TSQLRestServerFullMemory base server, not http connection or pure sql command.
Hello!
I have a TSQLRestServerFullMemory.
Create TSQLRestClientURIDll client and get tale data with and get table data with client.List() or client.RetrieveListJSON().
Program is working, BUT how can I convert retrieved data for DataSource.Dataset?
Thx, Csaba
Hi, I'm back.
-Make an default, minimal THttpServer, read first param for port number
-Create directory, copy server.exe
-create web.config, set my server name
-Make new website and setting application pool
But in the browser: server not found
Nothing work. What I write the url bar?
Hi, Exilon!
Please explain a bit more this method, I am very beginner in this area.
My test is not working. If possible send a mini mormot server source and explain IIS setting (convert to application, where set domain, port?)
Thanks, Csaba
Thank AB.
When I read 'infra', I think: this is a kind of infra ray (TV remote control, bar scanner).
Hi, AB!
First of all, congratulation for fantastic EKON 21 slide shows, especially DDD section!
DDD in mORM is many times clear than before.
One question: what mean word 'infra', is an abbreviation?
Csaba
Many thanks your fantastic support!
3.20.1 is out. This version add any future, error fix for waiting or I use current version in mORMot safety?
Thanks.
Thanks ab, it is really useful information. I will make a test for hybrid storage depends on size.
Dear mORMot community!
Is good idea store large blob in Sqlite file with information? Or store information only Sqlite and blob store as files in folder? I would use mORMotish way as possible?
Thanks, Csaba
Can I buy your book any digital format (pdf, mobi, epub)?
Hello!
Any plan for digital book version?
Fund the solution (maybe not optimal)
fClient := TSQLHttpClientWinHTTP.Create('localhost','888',fModel);
TWinHttp(fClient.Request)).OnProgress := DoProgress;
TWinHttp(fClient.Request)).OnDownload := DoDownload;
TWinHttp(fClient.Request)).OnDownloadChunkSize := 2;
Hello!
I can't use OnProgress and OnDownload for TWinHttpAPI, but not work.
fClient := TSQLHttpClientWinHTTP.Create('localhost','888',fModel);
TWinHttpAPI(fClient).OnProgress := DoProgress;
TWinHttpAPI(fClient).OnDownload := DoDownload;
TWinHttpAPI(fClient).OnDownloadChunkSize := 2;
Events not triggered. In TWinHttpAPI.InternalRetrieveAnswer: fOnDownload, fOnProgress is nil and fOnDownloadChunkSize = 0.
What's wrong my code?
Thx, Csaba
OK, this is a wrong way.
What is your recommendation?
Have a legacy project with SQLite database, Dephi standalone client.
My plan: SQLite database (external for first time, ORM later step by step), one backend server with interface-based service.
-Local net the fastest data transfer (many data manipulation, many user), only Delphi
-Mobil client only data read. Delphi or Android java.
Make I two server one for local and one for mobile or one server for both?
Which kind of server? TSQLRestServerDB or TSQLRestServerFullMemory?
Thank, Csaba
OK, I understand that.
From client side (FireMonkey, Android) can I connect to server via interface for not ORM server?
server side:
Props := TSQLDBSQLite3ConnectionProperties.Create('data.db3','','','');
HttpServer := TSQLDBServerHttpApi.Create(Props,'syndbremote','8092','user','pass');
client side:
client := TSQLRestClientHTTP.Create('????', 8092, TSQLModel.Create([]));
What is the connection string <server address>, or this way is not compatible ?
Csaba
Hi!
Create a small program (based on 27 - CrossPlatform Clients). Server run on Windows 10 PC, client run Android 6.01, FireMonkey.
Connection is successfully.
Question:
- What kind of server to connect with Crossplatform TSQLRestClientHTTP client?
- Is feasible: Crossplatform TSQLRestClientHTTP client edirect execute a SQL statement, like TSQLDBSQLite3ConnectionProperties.Execute('SELECT * FROM table1')
Thanks, Csaba
Thanks! Open the incoming port at the server side and everything is work.
Data transfer is very fast, like an local network!
Fantastic!
Csaba
Hi!
I try it the SynDBExplorer. Localhost and same pc with ip is working and everything is fine.
When I try establish connection between two pc in local net "Conection timeout" error.
What I need to setting?
Thanks, Csaba
Many, many thanks! Work it!
My fault, not released the ISQLDBRows instance!
Hi!
Open a SQLite databse file, read data, close.
Until not quit from program, the SQLite db file not move or delete.
aProp := TSQLDBSQLite3ConnectionProperties.Create(StringToUtf8(eDbName.Text), '', '', '');
aSynDb := ToDataSet(nil, aProp.ExecuteInlined('select * from vwTermenySor WHERE RS_Id IS NULL', true));
....
aProp.MainConnection.Disconnect;
aProp.MainSQLite3DB.DBClose;
aProp.Free;
How can I release SQLite db file completely?
Thx, CSaba
Hi!
Clear it a little my problem.
I want to use mORMot in my development process. First step using mORMot to data retrieve from an legacy SQLite3 database.
UI client using dbgrid with TClientDataset (all client write in Delphi)
-Connect to database: OK
-Use SQL select to data retrieve: OK
-What is the fastest way to convert retrieved data to existing TClinetDataSet, during the conversion I nedd to field mapping and field computing?
Csaba
Hi!
When I get data from legacy SQLite db with ToClientDataSet/ToDataSet:
can I convert or compute same data for TClientDataset? (field name not equal or compund field only in TClientDataset)?
Thx, Csaba
Thanks, it is clear answer.
Hi,
What is a recommendation? Use the mORMot files from the git folder directly or make a copy to another folder in developer environment?
Thanks, Csaba