You are not logged in.
@ab,
I thought even if the AutomaticTransactionPerRow parameter is leaved to 0, a transaction will still be created for the rows being inserted/updated?!
Looks I was wrong...
@Leslie7,
Very helpful! Clipped into evernote, thanks!
OK, I found something useful: https://www.nginx.com/resources/admin-g … rse-proxy/
Just not sure if https requests can be redirected transparently to a mORMot-server that handles "http" only...
@danielkuettner,
Can you provide some configuration snippets to show the big picture on using Apache/Nginx as a reverse proxy, to redirect http(s) requests to a mORMot-powered http server?
Thanks.
@mpv, thank you very much! I didn't know that, yes, it's human-readable already ![]()
Hello Arnaud,
For some code like TMyLog.Add.Enter(nil, 'My_Nested_Procedure'), it'll produce log entries like:
20161113 22131861 + => My_Nested_Procedure
20161113 22131861 info mylogmsg
20161113 22131900 info mylogmsg2
20161113 22131914 info mylogmsg3
20161113 22131919 - 00.327.901I assume 00.327.901 is the time elapsed? How can I change timespan format to a more human readable format, such as 00:02:59?
Thanks.
Try IdValue.
Hi Arnaud,
I'm also interested in the DDD examples. Will it lead to "class explosion" issue, since as I understand it, each record will not have an extra wrapping class?
@mpv,
That's great! I didn't realize that feature exists! So powerful the mORMot framework is!
Hello Arnaud,
I'd suggest adding the abillity to assign an event handler to TSynLogFamily or TSynLog, something like OnLogEntry, which allows capturing each log entry, including the logText, the level, and "enter method" event, and so on.
My original purpose is sending the log entry to the UI while logging to file, but such a event obviously adds flexibility to the framework ![]()
I think, you should use ServerTimeStampSynchronize, but just set the timeout when creating the client, for example, if in 0.5 second the ServerTimeStampSynchronize would not return, the connection would considered broken.
Hope it helps.
Wow! That's really a great achievement!
Is the list of that 119 node modules public somewhere?
Wow! If all the node.js built-in modules are implemented, it means that we will be able to **make use** of the vast amount of node modules available on the Internet, right?
@mpv,
Sorry, I'm not sure if I follow you...
All I want is to make sure the update **will fail** if the record's modified by another user.
Hello Arnaud,
How about adding a new parameter for specifying the condition when updating a record?
Something like:
Var
bat: TSQLRestBatch;
myRec: TSQLOrder;
oldTimeStamp: TDateTime;
begin
FDb.Retrieve(myRec...);
// remember the original timestamp of the record we are updating.
oldTimeStamp := myRec.LastUpdateTime;
// Here we use the record's original timestamp to **avoid** overwriting other users' edits.
bat.Update(myRec, 'LastUpdateTime = ?', [oldTimeStamp]);
...
end;Does it make any sense ![]()
Today I found some spare time connected from FireFox to the binding002 demo program, very cool ![]()
No, I mean updating the web server itself (ie. The .exe file on Windows).
I use the .obj files - it's statically linked.
@ab, yes, I've been using mORMot for a long time, and this is the first time i had such situation.
PS, the db file is not entirely corrupted - Some tables are completely ok, while one of the tables will emit the originally posted error message in the server log, but, some of the record data can still be read from that so-called malfunctioned table...
Hello,
With a mORMot powered web server (on linux), it is possible to achieve "hot code loading", instead of having to shutdown the program, update and restart again?
Thanks.
@ab, No, I'm not using any database-level encryption.
@mpv, Just checked, In my program, TSQLRestServerDB.Synchronous is set to smFull;// to ensure max data stability!
@chaa, If I understand you correctly - I'm not using RemoteDataCreate() nor TSQLDBSQLite3ConnectionProperties (nor its decadent classes) directly.
PS, My win7 has the latest updated, and the db file is inside a TrueCrypt 7.1a virtual disk, but I don't think it's the problem, since I've been using TrueCrypt for over 10 years now, it's extremely stable.
And another extended question - Is it possible to cause database corruption if the program accessing it is killed by the Windows Task Manager?
Experienced an error:
ESQLite3Exception {"ErrorCode":11,"SQLite3ErrorCode":12,"Message":"Error SQLITE_CORRUPT (11) [Step] using 3.15.0 - database disk image is malformed, extended_errcode=11"}Not sure why...
Full error msg below, I'm wondering if anybody have any ideas about...
20161018 21414020 EXC ESQLite3Exception {"ErrorCode":11,"SQLite3ErrorCode":12,"Message":"Error SQLITE_CORRUPT (11) [Step] using 3.15.0 - database disk image is malformed, extended_errcode=11"} at 006A540E SynSQLite3.sqlite3_check (5317) stack trace 00406C32 System.@FreeMem 0040DBE6 System.@DynArrayClear 0079C872 mORMot.TSQLModel.GetTableIndexesFromSQLSelect (32232) 007AFB63 mORMot.TSQLRestServerURIContext.ExecuteORMGet (38666) 007AE538 mORMot.TSQLRestServerURIContext.ExecuteCommand (38323) 0040B56F System.@LStrFromPCharLen 007ADA0A mORMot.TSQLRestServerURIContext.InternalSetTableFromTableName (38111) 0067477D SynCommons.SortDynArrayAnsiStringI (41926) 007B438E mORMot.TSQLRestServer.URI (39873) 0067DA82 SynCommons.TTextWriter.AddPointer (46786) 0090F457 mORMotHttpServer.TSQLHttpServer.Request (929) 008F79FF SynCrtSock.THttpServerGeneric.Request (3954) 008FC635 SynCrtSock.THttpApiServer.Execute (6408) 004A925D madExcept.HookedTThreadExecute (17342) 00538FF9 System.Classes.ThreadProc 0040B216 System.ThreadWrapper 004A9143 madExcept.CallThreadProcSafe (17277) 004A91AB madExcept.ThreadExceptFrame (17325)
20161018 21414022 ERROR DbSvr.TDbSvr(042175E0) {"ESQLite3Exception(026D01D0)":{"ErrorCode":11,"SQLite3ErrorCode":"secCORRUPT","Message":"Error SQLITE_CORRUPT (11) [Step] using 3.15.0 - database disk image is malformed, extended_errcode=11"}} for (SQL eliminated here...) stack trace API 0079F6C8 mORMot.TSQLRest.InternalLog (33183) 0090028E mORMotSQLite3.TSQLRestServerDB.GetAndPrepareStatementRelease (819) 00902326 mORMotSQLite3.TSQLRestServerDB.MainEngineList (1336) 007AFB63 mORMot.TSQLRestServerURIContext.ExecuteORMGet (38666) 007AE538 mORMot.TSQLRestServerURIContext.ExecuteCommand (38323) 007B438E mORMot.TSQLRestServer.URI (39873) 0090F457 mORMotHttpServer.TSQLHttpServer.Request (929) 008F79FF SynCrtSock.THttpServerGeneric.Request (3954) 004A925D madExcept.HookedTThreadExecute (17342) 00538FF9 System.Classes.ThreadProc 0040B216 System.ThreadWrapper 004A9143 madExcept.CallThreadProcSafe (17277) 004A91AB madExcept.ThreadExceptFrame (17325) Thanks!
It's recommended to use "batch mode":
http://synopse.info/files/html/Synopse% … l#NDX_1604
When creating the TSQLRestBatch instance, supply 'nil' for the 'aTable' param.
Caveat: When calling Add/Delete/Update methods of it, don't forget to pass the correct 'TSQLRecord' subclass, otherwise it won't work **siliently** ( suggested @ab to raise exception in this case, but he don't agree
.
Thanks for sharing! I'm also very interested in this feature, I am wondering why @ab rejected it.
Such offline feature is especially useful for a Point of Sales system, where the store front end is connected to the server, but we have to ensure the POS will keep working when it's disconnected from the server.
Just my 2 cents.
Thanks ab, very helpful!
Hello ab,
I have recently noticed this code example:
https://github.com/synopse/mORMot/blob/ … hIndex.dpr
Which you specifically wrote for answering a stackoverflow.com question - you have broaden my view on the mORMot's capability with two of your answers there, thanks ![]()
One quick question, I read some of your code:
var
db: TSQLRestServerDB;
procedure DoInsert;
var i: integer;
rec: TSQLEntry;
batch: TSQLRestBatch;
begin
rec := TSQLEntry.Create;
batch := TSQLRestBatch.Create(db,TSQLEntry,10000,[boExtendedJSON]);
try
for i := 0 to COUNT-1 do begin
......
batch.Add(rec,true);
end;
db.BatchSend(batch);
finally
......
End;Assume I have multiple threads doing the same insertion, each thread has its own TSQLRestBatch instance, but all are operating on the same TSQLRestServerDB instance. Is it thread-safe to do that?
Thanks.
Arnaud, Well done!
@ab,
So I also tried running the test, with xe4, and I've just updated to the latest rev: https://github.com/synopse/mORMot/commi … 5e58e8bd2b
Same as the op, the result shows the error also:
1. SynSMAPI
1.1. Syn SMAPI:
- Runtime creation: 10 assertions passed 28.64ms
- Compilation routines: 11 assertions passed 6.33ms
- Basic type delphi sm interop: 400,031 assertions passed 139.82ms
- Spidermonkey objects: 16 assertions passed 118us
- String and garbage collection: 3,017 assertions passed 15.05ms
- Native functions and object: no assertion 123us
- Multiple threads: no assertion 92us
- Basic sm structure wrappers: no assertion 85us
- Jslint support: 1 assertion passed 8.88ms
- External object: 44 assertions passed 330us
- Finalize: 1 assertion passed 1.21ms
Total failed: 0 / 403,131 - Syn SMAPI PASSED 203.05ms
2. SynSM
2.1. Syn SM:
- Create sm engine: 9 assertions passed 8.90ms
- External object: 43 assertions passed 11.97ms
- Sm value transformation: 90,020 assertions passed 1.73s
- Script evaluation: 14 assertions passed 2.86ms
! Syn SM - Load mustache template
! Exception ESMException raised with messsage:
! TSMEngine error: [JSError 110] mustache.js (533): function renderSection does
not always return a value
! Syn SM - Run mustache template
! Exception ESMException raised with messsage:
! TSMEngine.MakeObject(value: not an object)
- Run techempower template: no assertion 245us
- Array buffer support: 1,698 assertions passed 2.02ms
- Abort on timeout: 4 assertions passed 2.10s
Total failed: 1 / 91,790 - Syn SM FAILED 3.87s
Generated with: Delphi XE4 compiler
Time elapsed for all tests: 4.07s
Tests performed at 2016/9/22 14:55:11
Total assertions failed for all test suits: 1 / 494,921
! Some tests FAILED: please correct the code.
Done - Press ENTER to ExitBTW, So currently mORMot includes two versions of SpiderMonkey, thd old SM24, and the new SM45 recently announced by @MPV, is this correct? Which version do you and MPV suggest to use then? Thanks.
My most recent approach for handling detail items follows @ab's suggestion, except that **only use** types such as TObjectList, TStrings, etc (http://synopse.info/files/html/Synopse% … ml#TITL_26), that always stored as JSON arrays in the database.
Why so? Because you can take advantages of the JSON1 extension of SQLITE (https://www.sqlite.org/json1.html#jex), espciaally the json_each() function, to **directly access** the detail items in SQL, inlcuding joining regular table rows and json arrays, this is crucial, otherwise you'll lose the power of SQL statements.
In other words, do NOT use dynamic arrays to hold the detail items, because dynamic arrays will be saved as BLOB in the db.
This is my conclusion after hours studying and evaluating the JSON1 SQLite extension today ![]()
The ticket in question remains "Open", I'm not sure if this feature's already implemented or not? Thanks.
edwinsn wrote:Thanks for your answer, Erick, I understand you.
From what I have seen so far, EWB has advantages over SMS in that it's well documented, and is NOT mobile-only.
SMS is not mobile-only. It can generate web pages viewable on any device.
Erick
Yes, but "viewable on any device" != "designed with desktop web app in mind".
It's obvouse that, the layout and controls optimized for mobile web is different from one that's designed for traditional web apps.
Thanks for your answer, Erick, I understand you.
While at the moment I prefer a vue.js client talk to a mORMot server, I'll keep an eye on the development of both EWB and SMS.
From what I have seen so far, EWB has advantages over SMS in that it's well documented, and is NOT mobile-only.
Erick,
Congratulations! Just out of curiosity, why have you choosen EWB other than Smart Mobile Studio?
@Maciej,
Thanks for the clarification, the info you just provided is helpful to me (and to others I believe!).
It's really good to see the effort from you guys are consolidated into one.
Great work!
Few questions on the above topic.
Very good questions, yes, this confuses people.
I'm not able to answer all your questions, but here is my experience FYI:
I'm currently using https://github.com/LongDirtyAnimAlf/mORMot on **Windows**, and it can cross-comiple for Linux
I'm not sure about the latest versions, the last version I tried was one or two months ago. @AOG has done a great job here!
Re. NewPascal, as far as I know, currently it only offer download for Windows, and it does NOT cross-compile.
That being said, I also we can have one single download with these features:
- with the interface-patch integrated;
- runs on Windows but can cross-compile for Linux.
Actually, just FYI, I do NOT really want mORMot to be integrated into the compiler download, because mORMot updates so frequently and newPascal.org doesn't show it's interest/intention to keep up with the repository....
@emk,
Thanks for the info! Anyways, Erick (I assume he is the developer of EWB?) said in this post that he is working on an mORMot client library for EWB, and I believe that'll be useful also.
@erick,
Can't wait to see the mORMot interface library you are writing for EWB.
PS, does the EWB Pascal-to-JS completion also produces source-maps (https://developers.google.com/web/tools … maps?hl=en)?
@emk,
Thanks so much for the info. Now I'm interested in how it talks with the mORMot server, I think it's in this post:http://synopse.info/forum/viewtopic.php?id=3455
Will definitely try it when EWB supports code-completion.
Thanks, will check the video later.
Directly supporting css will be necessary, so that we can use external designs - either from open source frameworks, or designed by another designer.
@emk,
Thanks for the info, it's useful! Code-completion is about productivity so it's a must...
Does it support debugging?
Is it easy to integrate css frameworks such as the bootstrap framework?
@erick,
Checked the demo pages for Elevate Web Builder, sounds very powerful! And I see the controls are documented (this is most important).
Does the code editor support code completion?
What's the Pascal to JS engine do you use? I mean, is it the same as Smart Mobile Studio? SMS is cool, except that it targets **only mobile apps**.
@danielkuettner,
Just FYI, Though I've not used it, but PostgreSQL has been enhanced a lot in recent years, and is getting a lot of traction.
@ab,
I agree with you. It's more of an application design issue for handling large-scale data, rather than just about the capability of the backend DB system. But I believe that MS SQL server is easier to use than Postress, especially the administration tool part.
PS, since you mentioned use Nginx as the front-end for a mORMot application under Linux, do you have any instruction about setting up that? Thanks.
Thanks ab, good to know that!
@ab,
I understand you, breaking changes are evil...
@mpv,
I"m not ssure, but with Windows Server Core, you'll have to learn PowerShell? I'd rather use linux commands now ![]()
Does the Starter edition support installing third party experts such as CnPack and GExperts?
@StxLog,
I don't think so, reading the original object, cloning it and then saving it back to the DB with a new ID would be the way to go.
Hello ab,
Marco the Delphi PM has a new blog post which I guess you must have already noticed:
http://blog.marcocantu.com/blog/2016-au … oming.html
So we can expect that the next release of Delphi will support compiling binaries for Linux 64bit.
I think Delphi still has productivity advantages over Lazarus as an IDE.
Do you think of mORMot will follow? Maybe it's too early to talk about any decisions at the moment, but this news is still worth discussing ![]()
@mpv, this is huge! Well done!
mORMot should work just fine on it!
It will even give strong DB process on this edition, since our SynDB units are uncoupled from the main Delphi DB.pas units....
Looks like be-compatible-with-the-Starter-edition is a nice by product of you early decision - I remember you wrote that you decided not to depend on db.pas mainly for performance/lighweight-ness ![]()
I own this lib but haven't used it out side of DISQLITE3: http://www.wikitaxi.org/delphi/products/stemmer/index
But I guess you can integrate it with mORMot.