#651 Re: mORMot 1 » How to rollback transaction using batch processing in server side? » 2016-11-18 10:33:54

@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...

#652 Re: mORMot 1 » Linux ssl » 2016-11-17 06:42:29

@Leslie7,

Very helpful! Clipped into evernote, thanks!

#653 Re: mORMot 1 » Linux ssl » 2016-11-15 15:07:03

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...

#654 Re: mORMot 1 » Linux ssl » 2016-11-15 14:54:17

@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.

#655 Re: mORMot 1 » [solved] Question about SynLog.Enter() » 2016-11-14 07:55:15

@mpv, thank you very much! I didn't know that, yes, it's human-readable already smile

#656 mORMot 1 » [solved] Question about SynLog.Enter() » 2016-11-13 14:29:20

edwinsn
Replies: 2

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.901

I 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.

#658 Re: mORMot 1 » DDD Sample » 2016-11-07 15:50:29

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?

#659 Re: mORMot 1 » [solved] Suggestion - TSynLogFamily.OnLog event » 2016-11-04 13:34:51

@mpv,

That's great! I didn't realize that feature exists! So powerful the mORMot framework is!

#660 mORMot 1 » [solved] Suggestion - TSynLogFamily.OnLog event » 2016-11-04 06:15:50

edwinsn
Replies: 2

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 smile

#661 Re: mORMot 1 » From client side, how to detect the server has gone away. » 2016-11-02 16:27:14

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.

#662 Re: SyNode » Beta release of SyNode - ES6 JavaScript + NPM modules » 2016-11-01 05:42:00

Wow! That's really a great achievement!

Is the list of that 119 node modules public somewhere?

#663 Re: SyNode » Beta release of SyNode - ES6 JavaScript + NPM modules » 2016-10-31 15:17:54

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?

#664 Re: mORMot 1 » Update() and BatchUpdate() - Allow specifying update conditions? » 2016-10-30 18:20:05

@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.

#665 mORMot 1 » Update() and BatchUpdate() - Allow specifying update conditions? » 2016-10-30 07:48:15

edwinsn
Replies: 2

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 smile

#666 Re: SyNode » Beta release of SyNode - ES6 JavaScript + NPM modules » 2016-10-24 13:40:59

Today I found some spare time connected from FireFox to the binding002 demo program, very cool smile

#667 Re: mORMot 1 » Web development and hot code loading? » 2016-10-21 08:56:37

No, I mean updating the web server itself (ie. The .exe file on Windows).

#668 Re: mORMot 1 » Had an error "database disk image is malformed" » 2016-10-21 08:55:03

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...

#669 mORMot 1 » Web development and hot code loading? » 2016-10-20 09:17:57

edwinsn
Replies: 3

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.

#670 Re: mORMot 1 » Had an error "database disk image is malformed" » 2016-10-19 08:01:17

@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?

#671 mORMot 1 » Had an error "database disk image is malformed" » 2016-10-18 13:49:34

edwinsn
Replies: 8

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!

#672 Re: mORMot 1 » How To Save 2 TSQLRecord in the same time ? » 2016-10-05 04:03:54

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 smile.

#673 Re: mORMot 1 » Master/Slave replications - tips :) » 2016-10-05 03:53:54

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.

#675 mORMot 1 » About thread-safety about using TSQLRestBatch with TSQLRestServerDB » 2016-09-29 08:25:54

edwinsn
Replies: 5

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 smile

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.

#677 Re: mORMot 1 » Exception raised in TestSynSM: TSMEngine error: [JSError 110] mustache » 2016-09-22 06:59:57

@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 Exit

BTW, 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.

#678 Re: mORMot 1 » Is there some documentation on master detail relationships in mORMot? » 2016-09-21 14:15:35

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 smile

#679 Re: mORMot 1 » Perform ComputeFieldsBeforeWrite on server side » 2016-09-19 11:18:06

The ticket in question remains "Open", I'm not sure if this feature's already implemented or not? Thanks.

#680 Re: mORMot 1 » Elevate Web Builder » 2016-09-18 10:04:38

erick wrote:
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.

#681 Re: mORMot 1 » Elevate Web Builder » 2016-09-14 06:12:28

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.

#682 Re: mORMot 1 » Elevate Web Builder » 2016-09-13 15:37:57

Erick,

Congratulations! Just out of curiosity, why have you choosen EWB other than Smart Mobile Studio?

#683 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-09-12 08:37:59

@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!

#684 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-09-12 07:42:47

vonH wrote:

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 smile 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....

#685 Re: mORMot 1 » Elevate Web Builder » 2016-08-31 14:14:30

@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.

#686 Re: mORMot 1 » Elevate Web Builder » 2016-08-31 13:25:12

@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)?

#687 Re: mORMot 1 » NewPascal preview - fork for mORMot » 2016-08-31 13:19:48

@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.

#688 Re: mORMot 1 » NewPascal preview - fork for mORMot » 2016-08-31 10:06:47

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.

#689 Re: mORMot 1 » NewPascal preview - fork for mORMot » 2016-08-31 09:10:47

@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?

#690 Re: mORMot 1 » NewPascal preview - fork for mORMot » 2016-08-31 08:23:14

@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**.

#691 Re: mORMot 1 » Delphi for Linux preview - what do you think? » 2016-08-30 13:25:50

@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.

#692 Re: mORMot 1 » Delphi for Linux preview - what do you think? » 2016-08-30 10:33:46

@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.

#694 Re: mORMot 1 » Delphi for Linux preview - what do you think? » 2016-08-30 08:08:29

@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 wink

#695 Re: mORMot 1 » Delphi Starter Edition is now free » 2016-08-30 07:35:23

Does the Starter edition support installing third party experts such as CnPack and GExperts?

#696 Re: mORMot 1 » How to copy a row » 2016-08-29 12:21:09

@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.

#697 mORMot 1 » Delphi for Linux preview - what do you think? » 2016-08-29 12:19:39

edwinsn
Replies: 29

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 smile

#699 Re: Delphi » Free starter edition » 2016-08-23 17:33:01

ab wrote:

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 big_smile

#700 Re: mORMot 1 » Search engine » 2016-08-10 09:51:41

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.

Board footer

Powered by FluxBB