#901 Re: mORMot 1 » Simple Interface based server with database ! » 2015-04-12 09:37:09

Oops! Sorry for provided the non-standard method, that what came from my mind when I read your question tongue

#902 Re: mORMot 1 » Simple Interface based server with database ! » 2015-04-12 06:26:39

If your IServiceNote is supposed to be accessible in the clients, you can add a field of type TSQLRESTServerDB to TServicenote, and assign its value in the constructor, then in your AddNote() method you'll be able to access your REST DB SERVER.

#903 Re: mORMot 1 » Simple Interface based server with database ! » 2015-04-12 03:02:54

Do you mean something like:

myNode := TSQLNote.Create;
myNode.Title := 'no title';
aServer.Add(myNote);

?

#904 Re: mORMot 1 » HTTP JSON Client for a non-mORMot server » 2015-04-09 08:58:18

Hi Ab,

Can the REST client in mORMot to be used (or extended in the future) like this github project,  Delphi REST Client API, to consume standard REST serivces, such as Goolge API? Thanks.

#905 Re: mORMot 1 » Couldn't see changes by other process, because of caching? » 2015-04-03 02:33:04

Hi Arnaud, I assume even with the above mentioned two-way syncing implemented, we still have to take care of the IDs of the records not to be duplicated across offices, right?

#906 Re: mORMot 1 » Couldn't see changes by other process, because of caching? » 2015-04-02 14:02:43

ab wrote:
edwinsn wrote:

Does it mean once such a two-way syncing feature is implemented, I can have several databases synced with the very same set of data? I can help to test when it's added, what's your plan? Thanks.

Yes, this is the point.
But we won't use it directly this feature here, so testing will be welcome!

I suspect we may be able to add this TRecordVersion per-node generation in a very short term.

Great! I'll monitor this thread to get updates. Thanks.

#907 Re: mORMot 1 » Couldn't see changes by other process, because of caching? » 2015-04-02 09:01:36

ab wrote:

Yes, this is prepared for a future implementation.
The TSQLRestServer.InternalRecordVersionComputeNext function just need to be overriden with a timestamp + node suffix to have a monotonic multi-node version number.
There is just a limit of 58 bits, due to how TSQLRecordTableDelete.ID works.

Sounds like a good idea! Does it mean once such a two-way syncing feature is implemented, I can have several databases synced with the very same set of data? I can help to test when it's added, what's your plan? Thanks.

#908 Re: mORMot 1 » Couldn't see changes by other process, because of caching? » 2015-04-01 17:29:37

Congratulations on the new replication feature!

Two questions if you don't mind:
1 - For the "Corporate Servers Master/Slave Replication With Private Local Data" mode, are the two arrows in the graph have wrong directions? Shouldn't it look like this (notice the two red arrows I added):
2015-04-02_01h17_07.png

2 - I think one drawback of the master/slave replication mode is that the slave should be "read-only" to avoid duplicated version numbers. I'm not sure if I understand it correctly, but can we make this feature becoming two-way syncing by using different prefix for the server-wide TRecordVersion properties? For example, for rest server A in office A we use 1 as the version number prefix, while rest server B in office B has prefix of 2, and vice versa.

#909 Re: mORMot 1 » Error in TPrecisionTimer.Pause (win8 64bit) and (win7 32bit in a vbox) » 2015-04-01 14:54:52

Hi Arnaud,

The latest revision works without this problem. Thanks!

The executed SQL is something like

TSQLAccount.CreateAndFillPrepare(Self, 'ORDER BY AccountType, UserName'); 

and I don't think there is anything special......

#910 mORMot 1 » Error in TPrecisionTimer.Pause (win8 64bit) and (win7 32bit in a vbox) » 2015-04-01 08:17:22

edwinsn
Replies: 2

Hi Arnaud,

I was having this EAccessViolation with an older version, so I updated my copy of mORMot yesterday. While it's Ok on my Win7 64bit on a physical box, but the error still happens at least in two environments according to my tests:
1 - a win8 64bit in a virtual box.
2 - a Win7 32bit in a Virtual Box.

Additionally, another test was on another physical which runs Win 8.1 64bit and the same error happened.

I wish you can help. Thanks.

date/time          : 2015-04-01, 15:10:27, 623ms
operating system   : Windows 8 x64 
processors         : 2x Intel(R) Core(TM) i5 CPU 760 @ 2.80GHz
physical memory    : 1246/2048 MB (free/total)
compiled with      : Delphi XE4
callstack crc      : $005eb437, $d7f9a897, $e910b5c5
exception number   : 1
exception class    : EAccessViolation
exception message  : Access violation at address 774A753C in module 'ntdll.dll'. Write of address 00000010.

main thread ($598):
774a753c ntdll.dll                                RtlQueryPerformanceCounter
006c56f7 Program1.exe SynCommons           38120 TPrecisionTimer.Pause
00a4559b Program1.exe mORMotSQLite3          747 TSQLRestServerDB.GetAndPrepareStatementRelease
00a473ec Program1.exe mORMotSQLite3         1238 TSQLRestServerDB.MainEngineList
7749ddb6 ntdll.dll                                KiUserExceptionDispatcher
008243bb Program1.exe mORMot               33928 TSQLRestServer.EngineList
00813988 Program1.exe mORMot               28691 TSQLRest.ExecuteList
0081154f Program1.exe mORMot               27930 TSQLRest.MultiFieldValues
00809b2a Program1.exe mORMot               25575 TSQLRecord.CreateAndFillPrepare
00ba8d8c Program1.exe DataStoreClient        139 TDataStoreClient.LoadAllAccounts
......
00543c58 Program1.exe System.Classes             StdWndProc
768493cc user32.dll                               DispatchMessageW
006898bf Program1.exe Vcl.Forms                  TApplication.ProcessMessage
00689902 Program1.exe Vcl.Forms                  TApplication.HandleMessage
00689c3d Program1.exe Vcl.Forms                  TApplication.Run
00e17b47 Program1.exe Program1              231 initialization
7701495b KERNEL32.DLL                             BaseThreadInitThunk

#911 Re: mORMot 1 » Using interfaced based and defining a POST-method » 2015-03-26 11:36:05

By the first version do you mean URL-encoded parameters? According the document provided by Arnaud above, it seems the URL parameters are only considered if the body content of your POST is empty. If you use the body content of the POST method, the format has always to be JSON. I think this is a adequate design, your "first version" is similar to INI files, and it will not be able to express some complex contents. JSON is THE format for transferring web data  nowadays.

#912 Re: mORMot 1 » implement push notifications » 2015-03-24 10:07:12

@ab, noted. Thanks for your effort!

#913 Re: mORMot 1 » implement push notifications » 2015-03-24 07:31:39

ab wrote:

I'm waiting for all tests to pass

Hi Arnaud, since I always use the latest github repository and I don't run the tests locally, it occurred to me that, do you commit when not all tests pass? If yes, would you add something like 'all tests pass' or 'not all tests pass' for each commit? So that one will know which revision to use. Thanks for your effort!

#914 Re: mORMot 1 » implement push notifications » 2015-03-24 07:26:36

Good job! We'll see how to use it when an example is provided.

#915 mORMot 1 » [REOPEN] No equivalent method for the "INSERT OR UPDATE" statement? » 2015-03-16 11:43:00

edwinsn
Replies: 0

Hi Arnaud,

SQLite's "INSERT OR UPDATE..." statement (https://www.sqlite.org/lang_insert.html) is very handy as we don't need to check the existence of a record, and another benefit is avoiding unnecessary network round trip in a C/S environment.

I did a GREP into the mORMot source tree, I assume there is not a equivalent method yet? If no, can I make a suggestion smile

Update: Well, I misunderstood the AddOrUpdate() method in mORMot - it's NOT the equivalent of the "INSERT OR UPDATE" SQL statement in SQLITE. Sorry.

#916 Re: mORMot 1 » Need simple MVC web app using synmustache sample project... » 2015-03-12 10:17:24

Hi Arnaud,

I'm at the stage of evaluating using the MVVM mechanism provided by mORMot, if I go ahead, I'd rather spend time on more useful things, like making mORMotMVC.pas to have an option of always loading files from disk, so that one can tweak and test the html/css/js in realtime without having to restart the program.

It's an example, using bootstrap or other css framework is not important for the purpose of demonstration.

#917 mORMot 1 » Limiting browser client to local IP » 2015-03-12 04:34:41

edwinsn
Replies: 1

I want to restrict connection from local web browsers only, after some research, I found one solution - overwrite

THttpServer.Process()

and check

self.RemoteIp

My question is, it'l be better to handle that in my TMVCApplication-derived class, something like if the client is not 127.0.0.1 nor localhost, redirect to access-not-allowed.html. Is this possible? Thanks.

Update 1:
One more possible solution: Overwrite

TSQLHttpServer.Request()

But I'm not sure is it possible to get the client IP in this method...

#918 Re: mORMot 1 » Need simple MVC web app using synmustache sample project... » 2015-03-11 13:55:36

IMHO http://semantic-ui.com/  as two advantages over bootstrap:

- It's syntax is sematic!
- It's built-in themes (several of them) are much good-looking .

#919 Re: mORMot 1 » MVC Web App, want to retrieve View files from DB, how? » 2015-03-09 15:37:25

Re. the questions raised by delphiancoder (ie. not always loading files from disk), I suggest to add a boolean property to TMVCViewsMustache called CacheFiles, eg:

 TMVCViewsMustache.CacheFiles: Boolean

, to indicate if the files should be cached vs. always loading from the disk.

#920 Re: mORMot 1 » MVC Web App, want to retrieve View files from DB, how? » 2015-03-08 09:17:20

delphiancoder wrote:

Hi,

during my tests I noted that changing the blog.css  file  (to reduce title and text sizes) nothing changed until kill and run the server runtime again. So I suppose the files are readed on startup and anything stay in ram.  reading from inside the database will add no speed,  I suppose.  Arnaud, is this correct ?

I did a quick look, yes, in TMVCViewsMustache.Create() the engine loads all the .html and .partials files into memory. I think it should offer an option to always load the view files from the real source.

I also suggest to add an event so that we can intercept the loading of the view files, something like OnLoadViewFileContent(aViewFileName: string: var aContent: string);

#921 mORMot 1 » MVC Web App, want to retrieve View files from DB, how? » 2015-03-08 08:27:04

edwinsn
Replies: 5

Hi Arnaud,

Just checked out the '30 - MVC Server' example along with the MVC secctions in the document, I really like the convention over configuration concepts, which is time saving in coding the program.

I noticed that the view files (.html, .partial, .css, etc) are retrieved from a disk folder. What should I do if I want those files to be loaded from  BLOB fields of a DB? Thanks.

#922 mORMot 1 » Suggest: SQLiteStudio - a very full featured SQLite manager program! » 2015-03-07 10:55:15

edwinsn
Replies: 0

I came across it today, it's open source and written in Qt, most importantly, it very powerful (from my first impression).

http://sqlitestudio.pl/?act=gallery

#924 Re: mORMot 1 » How to make sure record Ids are globally unique across multi DB? » 2015-03-06 12:27:40

Hi Arnaud,

For situation like a POS system I described above, a mORMot server usually serves less than 10 PC clients - Do you think it's sufficent to use SQLite (instead of real DB system like MS SQL Server) as the underlying databse in situation like that?

I remember you mentioned other people is using mORMot/SQLite to serve a lot of data and a lot of client PCs, but I couldn't find that info... Thanks.

#925 Re: mORMot 1 » Client-side grid edit demo/sample? » 2015-03-06 07:07:01

Hi Arnaud,

We have ToClientDataSet(), can we have a FromClientDataSet()?

#927 mORMot 1 » How to make sure record Ids are globally unique across multi DB? » 2015-03-04 18:11:43

edwinsn
Replies: 5

Hi friends,

Imagine we have 10 POS system running standalone, and at the end of the day all the sales data will be synced to the master server at headquarter for building analysis reports.

That means we have 10 databases of the very same table structure, and ALL the data from those 10 databases will be synced to a SINGLE master database at the end of the day.

Obviously we cannot use the default primary key (ID) generation in mORMot, because we should avoid duplicated Ids in the master database. So what will be the correct way of avoiding duplicated ID?

One option I can think of is manually assigning record Ids, and each record ID has a unique DB server ID. But I suspect there are simpler solutions? Thanks.

Thanks.

#928 Re: mORMot 1 » Will there be TSynLog and TMemoryMapText for linux OS ? » 2015-01-22 07:12:51

Thanks for info, Arnaud, they make sense! I'm especially want the linux support in the future versions of Delphi.

#929 Re: mORMot 1 » Will there be TSynLog and TMemoryMapText for linux OS ? » 2015-01-20 10:12:44

Hi Arnaud,

I might be wrong, but I assume supports also Kylix will cause a lot of IDEF's, is there a reason to still support a project that's dead for ten years?

#931 Re: mORMot 1 » mORMot bigData future and actual state » 2015-01-10 03:57:14

gm wrote:

I'm just looking for the best approach for a scenario where maybe I can't have the HttpServer and the database in the same computer (VM) because of clones of VM httpServers are launched on demand automatically.

You might consider PostgreSQL - I haven't used it, but from what I have read on Hacker News in recent years, PostgreSQL is getting better and better, two big things I remember are 1) full text search enhancement, and 2) enhanced support for JSONB  (document-based storage, think MongoDB!)

And it'll be interested to see how you implement that load-balance-controlled booting of your web servers. Which cloud provider you are planning to use?

#932 Re: mORMot 1 » Interface now working with FPC ! » 2015-01-10 03:39:28

Good news Arnaud, I see the bright future of mORMot for FPC on Linux. The last time an EMBT sales representative asked me what would make me upgrade to the latest Delphi, I said Linux support for the non-GUI stuff might be interesting, now it seems that we almost have full support for FPC smile

#933 Re: mORMot 1 » Event-Driven Dev » 2015-01-08 09:04:59

I haven't a chance to develop for Linux yet, but it'll be great if you then have a blog post for tips and steps on how your setup your development environment for Linux smile

#934 Re: mORMot 1 » mORMot bigData future and actual state » 2015-01-08 03:41:56

@gm, I don't have done any test, but mORMot just feels fast than enough to me in my experiences.

#935 Re: mORMot 1 » Event-Driven Dev » 2015-01-06 05:51:05

ab wrote:

we rely on FPC for our Linux support, which is a must have for our own hosting now - and for a lot of our users.

Hi Ab, are you already using the FPC/LINUX version of mORMot now for production?

#936 Re: mORMot 1 » The future of mORMot is BigData » 2015-01-05 05:44:21

Hi ab, this may sound like a dumb question, but is it possible to use WiredTiger in a way like using Sqlite - use it's binary and mORMot interface with it?

#937 Re: mORMot 1 » The future of mORMot is BigData » 2015-01-02 04:01:55

My first time hearing about WiredTiger, from the github stars, it doesn't seem to be very popular, but you must choose it over others for some good reasons smile

And I thought similarly to the Monkey http server.

And happy new year!

#938 Re: mORMot 1 » OFF-TOPIC: Merry christmas... » 2014-12-25 05:57:58

圣诞快乐! To Arnaud and all others!

#939 Re: mORMot 1 » CopyRecord » 2014-12-10 06:59:40

You are so quick, AB!

#940 Re: mORMot 1 » CopyRecord » 2014-12-09 10:59:29

Hi Arnaud,

It seems that TSQLRecord.CreateCopy doesn't copy published properties of type TStrings?

#941 Re: mORMot 1 » HTTP remote access for SynDB SQL execution » 2014-11-26 08:03:53

Hi Arnaud, so even without transaction support, with this remote SQL execution feature, you just made SQLite a real multi-client database server, at least for Delphi programmers smile

#942 Re: mORMot 1 » Documentation updated to revision 1.15 » 2014-11-17 09:58:40

I'm quite satisfied with the PDF version with SumatraPDF.

#943 Re: mORMot 1 » Use unified ID (primary key) for multiple tables? » 2014-11-14 12:35:56

HI Ab, with the recent changes, the ID is of type int64 now, so looks like I can use unified IDs (primary key) for multiple tables now!!??

#944 Re: mORMot 1 » SynDBExplorer returns no result for the EXPLAIN statement? » 2014-11-14 10:05:28

ab wrote:

There have been a lot of new things in the past two months.
But nothing that would not be identified at compile time IMHO.


Thanks! Updated to the latest source, with several minor modifications!

#945 Re: mORMot 1 » SynDBExplorer returns no result for the EXPLAIN statement? » 2014-11-13 16:13:42

Thanks for the quick fix!

so I'll be upgrading to the latest rev. The mORMot source I'm using is 2 months old, I assume the latest source does not break backward compatibility, right?

#946 mORMot 1 » SynDBExplorer returns no result for the EXPLAIN statement? » 2014-11-13 15:15:45

edwinsn
Replies: 4

Hi Arnaud,

SynDBExplorer returns no result for the EXPLAIN statement? Thanks.

#948 Re: mORMot 1 » Documentation updated to revision 1.15 » 2014-11-07 14:06:11

The HTML version of the document is great! Now I can utilize the Google search engine smile

#949 mORMot 1 » What will happen if I change my TSQLRecord to TSQLRecordFTS4 » 2014-11-06 16:30:44

edwinsn
Replies: 3

Hi Arnaud,

Assume my program is already working with some TSQLRecord derived classes, all have string, integer, float and TDateTime fields.

if I change them to inherit from TSQLRecordFTS4, will all old functionalities still work? I mean, if non-string fields still working after changing to FTS4?

What I want is keep the old functions working, but plus some FTS functions provided by FTS4.

Thanks!

#950 Re: mORMot 1 » Wow! Full FPC support now??!! » 2014-10-29 08:36:42

Alfred,

>1) what is the system you are compiling on ?
>2) CodeTypon version ?
I'm not using CodeTyphon, but the latest Lazarus:

Lazarus version: 1.2.6
Lazarus svn revision: 46529
Lazarus build date: 2014/10/11
Lazarus was compiled for i386-win32
Lazarus was compiled with fpc 2.6.4

3) what is your target system ?
Target OS is win32 (I'm using win 7 64bit, but I don't think it's a problem).
Target CPU family is default
Target processor is default.

Changed values in Synopse.inc:

  {.$MODE DELPHI} // e.g. for asm syntax - disabled for FPC 2.6 compatibility
  {$define NOSQLITE3STATIC}

Let me know if you need more info.

Board footer

Powered by FluxBB