#701 Re: mORMot 1 » modify record structure on database in production » 2016-08-10 09:49:29

What you did wouldn't work.

I think you should do it this way:
- Do not change the definition of TImmobile  and Immobili.
- Add a new type TImmobileNew with the new 'Varia' field added.
- Add a new property ImmobiliNew of type TImmobileNew.
- Migrate the data from 'Immobili' to 'ImmobiliNew'.

#703 Re: mORMot 1 » TSynBloomFilter » 2016-07-31 05:20:59

Well done Arnaud, this is a new concept to me, and through all these years I have been watching you and other contributors never stop enhancing the framework, what a good thing to the Pascal/Delphi community.

#704 Re: mORMot 1 » Why Client.Add can not save the associated instance's correct Id ? » 2016-07-27 07:05:02

It might not obvious, but the third parameter called "ForceId" must be "True", in order to save to DB using the ID you assigned.

#706 Re: SyNode » Adding JavaScript support for mORMot framework » 2016-07-23 15:15:03

@mpv, the new SynSM45 is impressive! Thanks for your effort.

#708 mORMot 1 » [solved] BatchUpdate() doesn't support updating record ID, right? » 2016-07-23 09:14:46

edwinsn
Replies: 2

Hello Arnaud,

My understanding is that the BatchUpdate() method does NOT support updating the record ID itself, right?

#709 Re: mORMot 1 » Suggestion - Add BatchAddRawSql() to the batch update mechanism :) » 2016-07-23 08:11:38

Hello Arnaud,

I'm not sure your priority, anyways, the ticket system shows that the ticket is "open", so I guess you haven't added it yet smile

#710 Re: mORMot 1 » NewPascal with mORMot - first release » 2016-07-15 06:47:16

Congrats hnb.

I noticed the mORMot-not-included download is no longer available?
You know, some people like me might have already installed mORMOt manually, or prefer to setup mORMot manually, for easy keeping update with the github repos......

Cross-compile feature would be the most needed feature IMHO, because it's the most difficult part for a new Lazarus user, on the other hand, other other tasks, like setting up mORMot for Lazarus, is not that hard.

Currently I'm enjoying Alred's cross-compile distribution smile

#711 Re: mORMot 1 » [not-an-bug] Zero-length log files? » 2016-07-12 10:06:14

Oh! I was so wrong! Thanks ab, corrected my program and I'll see what happens smile

#712 Re: mORMot 1 » [not-an-bug] Zero-length log files? » 2016-07-12 07:31:54

Hello ab,

Actually, there are two kinds of empty files:

  - Log files whose length is 0 byte, and I checked it with a text editor, they are really empty.
  - Log files only has some header info, without any log entry, the following is copied from a real-life log file:

C:\_Data\DelphiDev\app1\App\Bin\app1_Server.exe 0.9.8.932 (2016-07-12 13:59:05)
Host=EDWIN-Notepad User=edwin CPU=4*9-6-15620:FFFBEBBFBFFBFA7D OS=11.1=6.1.7601 Wow64=1 Freq=2143496
Environment variables=
TSynLog 1.18.2774 FTS3 2016-07-12T14:49:47

And my code for setting up the logging:

procedure TServerMgr.SetupServerLogging;
begin
  TSynLog.Family.Level := LOG_VERBOSE;

  TSynLog.Family.AutoFlushTimeOut := 10;
  TSynLog.Family.OnArchive := EventArchiveZip;
  TSynLog.Family.ArchiveAfterDays := 7;
  TSynLog.Family.NoEnvironmentVariable := True;
  TSynLog.Family.LocalTimeStamp := True;

  TSynLog.Family.DestinationPath := GetServerLogsFolder;
  ForceDirectories(TSynLog.Family.DestinationPath);
end;

Any findings smile

#713 mORMot 1 » [not-an-bug] Zero-length log files? » 2016-07-12 06:02:28

edwinsn
Replies: 4

Did anybody notice the recent version of mORMot generates log files that's empty?

I'm not sure since when (maybe about several weeks ago), but this problem wasn't existed since I use mORMot for years smile

#714 Re: mORMot 1 » mORMot ORM (One-to-many) in pratice » 2016-07-12 05:30:46

I handle the one-to-many relationships outside of the mORMot, for flexibility, freedom and clarity.

I mean, define the classes like this:

TSQLItem = class(TSQLRecord)
published:
  property HeaderId: TID; // Reference to the master table
end;

TSQLHeader = class(TSQLRecord)
public // not published
  Items: TObjectList<TSQLItem>;
end;

We saving, the program set TSQLItem.HeaderId to the ID of the corresponding header.

When retrieving, the program load the header and item separately, something like:

  myDb.Retrieve(myHeader, aHdrId);
  myHeader.Items := myDb.RetrieveList<TSQLItem>('HeaderID = ?', [], [aHdrId]);

I'm not sure what others think, but to me the built-in support for one-to-many relationship provided by the framework is too limited and not flexible.

And this is why I like mORMot - it finds a very good balance between "an ORM that completely abstract away the relational database concept" and "Directly use TDataSet". In other words, it does the tedious CRUD work excellently for me, while also let me easily take advantages of the proven SQL concept.

#715 Delphi » What's your sugestions on preparing a GUI program for Lazarus? » 2016-07-10 10:36:53

edwinsn
Replies: 1

It might be a good idea to make our code as much prepared for Lazarus/FPC as possible, while still using Delphi as the development tool for the sake of productivity.

And the following are my initial thoughts, I encourage you to add your valuable points, since this can be served as a general guide for the community smile

Prerequisites
===
We must split our program into modules - the app logic and the services (including UI service and other system services such as service for accessing the file system.


The idea
===
The idea behind the following opinions is **prepare for changes**, which itself is a general rule of developing software.

The plan
===

So let's see what might change for a Delphi GUI program that needs to be compiled with FPC and also run other desktop OSs supported by LCL:

* The language. There is not much we can do for this, maybe don't use language features those not supported/compatible by FPC, for example, anonymous methods and generics.

* The RTL.  The run-time library is actually application services needed by our program. We should organize and encapsulate the services into interfaces, for example, all functions for accessing the file system should be defined by the IFileSys interface, and we can implement it separately for Delphi and FPC - we can even have one implementation for Linux while another for Mac OS.


* The basic data types - especially the **strings**. The String in Delphi and the String in FPC is different - they are not binary-compatible. I also heard that FPC has a recent breaking change and broke some existing code, and they seem also has a plan to change it for utf16 IIRC (links pending). So it might be a good idea to use a fixed string type as the foundation for our program from the very start.

In this regard my first idea is to use UTF8string across the compiler and platform, for two reasons:
- utf8 is proven and is vastly widely used.
- The SynCommons.pas included by the mORMot framework already has a lot of **cross-platform** functions for string manipulation, that are already compatible by both Delphi and FPC.

A sidenote: We should really consider using SynCommons.pas as the "RTL" - it's feature rich, and it is already compile-able under Delphi and FPC for Windows and Linux.


It's just my humble options, and I'll be appreciated if you can provide any help on this.

---
Edwin Yip

#716 Re: mORMot 1 » NewPascal preview - fork for mORMot » 2016-07-07 14:59:28

AOG wrote:

Current trunk has some optimalization problems. Please try -O1 as optimization level.

Thanks. Will try and test this with Ubuntu sever 16.04 LTS 64bit when I find some time...

#717 Re: mORMot 1 » NewPascal preview - fork for mORMot » 2016-07-07 12:36:34

Re. the path, I agree with ab, "C:\Users\Public\Documents\NewPascal" is way too verbose.

@AOG, I must was doing something wrong, now I switched the "Build Modes" set by ab for the TestSQL3.lpr project, I have successfully compiled the 4 targets:
- win32 (all tests passed)
- win64 (Total assertions failed for all test suits:  21 / 8,415,516)
- linux_x86_64 (untested)
- linux_i386 tested under Linux Mint xfce 32bit, see below for results:

 2.11. DDD shared units: 
  - User model: 3,276 assertions passed  507us
! DDD shared units - Authentication model
! Exception EAccessViolation raised with messsage:
!  Access violation
  - Email validation process: 55 assertions passed  38.36ms
! DDD shared units - User CQRS repository
! Exception EAccessViolation raised with messsage:
!  Access violation

 2.12. DDD multi thread: 
  - Delete old database: 1 assertion passed  29us
  - Start server: 1 assertion passed  13.71ms
  - Single client test: 1,002 assertions passed  186.52ms
  - Multi threaded clients test: 21 assertions passed  386.34ms
  Total failed: 0 / 1,025  - DDD multi thread PASSED  586.73ms


Using mORMot 1.18.2771 FTS3
Running on Linux-3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 09:37:25 UTC 2015
TSQLite3LibraryStatic 3.13.0 with internal MM
Generated with: Free Pascal 3.1.1 compiler

Time elapsed for all tests: 100.05s
Tests performed at 07/07/2016 08:29:51 PM

Total assertions failed for all test suits:  0 / 20,127,664
! Some tests FAILED: please correct the code.

#718 Re: mORMot 1 » NewPascal preview - fork for mORMot » 2016-07-07 11:08:45

@AOG, This is awesome!

Re. the installation path configuration in the future, maybe just add an exe file for changing the path (which is now fixed to "c:\NewPascal")? Actually it's really really really good to just download the .zip files - it's just like the so-called portable programs, which would not force us to do the re-installation after a system re-installation. No installer is needed, that'll cost unnecessary time in maintaining them. We are all developers and we can handle .zip files wink 

And my testing results:

- win64: There is no win64 compile support, maybe you are missing some files in FPCLazBaseWin32.rar? Result:

Error: Illegal parameter: -Twin64

- win32: Compiled and the tests run successfully.

- linux i386:
    when {$define PUREPASCAL} is on, I got:

      SynCommons.pas(56789,3) Error: Identifier not found "GetCPUID"

    Otherwise I got:

..\fpc-linux32\sqlite3.o:(.data+0xc28): undefined reference to `lstat64'
C:\NewPascal\fpc\units\i386-linux\rtl\si_c21.o: In function `SI_C21_$$__FPC_LIBC21_START':
si_c21.pp:(.text.n_si_c21_$$__fpc_libc21_start+0x27): undefined reference to `__libc_csu_fini'
si_c21.pp:(.text.n_si_c21_$$__fpc_libc21_start+0x2c): undefined reference to `__libc_csu_init'
TestSQL3.dpr(190,1) Error: Error while linking

  - Linux x86_64: Successfully compiled (but did not test running it), with the following added to my .lpr file:

// START http://bugs.freepascal.org/view.php?id=30112
{$ifdef FPC}
  {$ifdef Linux}
    {$ifdef FPC_CROSSCOMPILING}
        {$linklib libc_nonshared.a}
    {$endif FPC_CROSSCOMPILING}
  {$endif Linux}
{$endif FPC}
// END  

#719 Re: mORMot 1 » NewPascal preview - fork for mORMot » 2016-07-07 08:25:06

alpinistbg wrote:

Target was win32.

Yes. Unfortunately the New Pascal Pack doesn't support win64 so I'm unable to try it out...

#720 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-07-07 07:39:52

Now I want to try AOG's latset Lazarus distribution for cross-compiling for Linux - the Lazarus distribution downloaded from newpascal.org does NOT support cross-compiling for Linux...

#721 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-07-07 07:37:29

Oops! I suddenly deleted those 3 sub-folders included by the slite3fpc.7z - I thought it was produced during the FPC compilation, my bad...

And the good news, all tests went successful!

Using mORMot 1.18.2771 FTS3
Running on Windows 7 64bit SP1 (6.1.7601) with code page 936
TSQLite3LibraryStatic 3.13.0 with internal MM
Generated with: Free Pascal 3.1.1 compiler

Time elapsed for all tests: 67.46s
Tests performed at 2016/7/7 15:35:00

Total assertions failed for all test suits:  0 / 21,401,191
! All tests passed successfully.

#722 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-07-07 07:19:24

@AOG,

Tried, but I absolutely have no idea why it needs the .o file (see logs below) - my compilation target is default (also tried the win32 target).

TestMormotOfficial.lpr(9,1) Error: Can't open object file: fpc-win32\sqlite3.o
TestMormotOfficial.lpr(9,1) Error: Can't open object file: fpc-win32\libkernel32.a
TestMormotOfficial.lpr(9,1) Error: Can't open object file: fpc-win32\libgcc.a

I tried both the TestSQL3.lpi shipped in the official mORMot repository, and also the project file created when started this forum post, like the following:

program TestMormotOfficial;
{$I Synopse.inc}
{$APPTYPE CONSOLE}
uses
  {$I SynDprUses.inc}
  mORMotSelfTests;
begin
  SQLite3ConsoleTests;
end.          

#723 Re: mORMot 1 » NewPascal preview - fork for mORMot » 2016-07-07 07:01:07

On July 7, 2016 all tests went OK using the newpascal.org distribution: http://synopse.info/forum/viewtopic.php … 989#p20989

#725 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-07-07 06:55:03

2016-07-07 test:
Compiler:
https://github.com/dathox/newpascalpack … alpack.zip

mORMot distribution:
https://github.com/LongDirtyAnimAlf/mORMot

Target: i386-win32:

Result:
All tests passed! Well done you guys smile

Detailed results:

Using mORMot 1.18.2753 FTS3
Running on Windows 7 64bit SP1 (6.1.7601) with code page 936
TSQLite3LibraryDynamic 3.8.10.2 with internal MM
Generated with: Free Pascal 3.1.1 compiler

Time elapsed for all tests: 65.12s
Tests performed at 2016/7/7 14:51:50

Total assertions failed for all test suits:  0 / 21,319,038
! All tests passed successfully.

#726 Re: mORMot 1 » TestSQL3.exe - Lazarus_fpcup 1.7-Win32 fpc 3.1.1 (2016-06-17) » 2016-07-06 14:20:56

@AOG,

I still haven started using Lazarus. So today I downloaded the official mormot and your fork for fpc, I compiled the testsqlit3 project successfully with the fpclazrtticross Lazarus/FPC distribuation you provided earlier.

But interestingly, it emits the following runtime error:

[Window Title]
Error

[Content]
Project TestSQL3 raised exception class 'External: SIGSEGV'.

 At address 458577

[OK]

I think I should download a new version of your cross-compile-ready Lazarus, or download and use the https://github.com/dathox/newpascalpack instead?

I'm a bit confused by the newpascal.org project now - it seems that it integrates your work, but from what I see in the download .zip file, it doesn't contain files for cross-compiling for Linux.

Thanks in advance, for your possible clarification and advises smile

#727 Re: mORMot 1 » NewPascal preview - fork for mORMot » 2016-06-30 13:53:41

Well done AGO and hnb smile

BTW, I think it's necessary to include some release notes, for example, this release should include the notes about the inclusion of the enhanced RTTI.

Just a suggestion smile

#728 Re: mORMot 1 » [fixed] Is there a way to force new log file? » 2016-06-27 11:42:50

Great! That did the trick!

I previously tried Release(), but didn't try this one :;

#729 mORMot 1 » [fixed] Is there a way to force new log file? » 2016-06-27 10:53:46

edwinsn
Replies: 2

Hello Aranud,

I made a TSynLog derived class and customize the log options, like:

type
  TMyLog = class(TSynLog)
  end;
  ...

  // I setup the log options in the constructor of my object that uses this log class, like this:
  procedure TMyThread.Create;
  begin
    TMyLog.Family.CustomFileName := 'MyLogFile';
  end;
  ...

  // and I add logs like this:
  TMyLog.Add.Log(sllInfo, '...');
  ...  
  

With these setup, my log files look like: "MyLogFile 20160627 143255.log", which is OK, and my Question: is:

How to force it to create a new log file? Thanks.

#730 Re: mORMot 1 » NewPascal preview - fork for mORMot » 2016-06-27 10:10:53

@ab, hey! That's my comment wink Yes, I'm Edwin Yip smile

PS, IIRC the fpc/lazarus distribution I downloaded from @AOG's Google Drive does have cross-compile support, isn't the one provided by newpascal.org the same version by @AOG?

#731 Re: mORMot 1 » [fixed] Log indentation? » 2016-06-27 06:07:52

The TSynLog.Enter() method sounds like a good option for this purpose!

#732 mORMot 1 » [fixed] Log indentation? » 2016-06-27 03:48:36

edwinsn
Replies: 1

Hello Arnaud,

What's your option on log indentation? That'll be useful for logging tasks with sub-tasks, for example:

Start long task A.
  sub task a1...
  sub task a2...
    sub-sub-task a20001
    sub-sub-task a20002
    sub-sub-task a20003
    .....
  sub task a3...
  sub task a4...
End log task A.
Start long task B...

#733 Re: SyNode » Adding JavaScript support for mORMot framework » 2016-06-26 10:14:45

Sounds great, @BeRo1985!

PS, I'm OK if it doesn't support pre-unicode versions of Delphi.

#734 Re: SyNode » Adding JavaScript support for mORMot framework » 2016-06-25 11:17:35

Well done BeRo1985! I wish you'll support FPC as well smile

#736 Re: SyNode » Adding JavaScript support for mORMot framework » 2016-06-17 18:37:38

@BeRo, that would be great!

Would the project backed by a complete test suite for the js langauge? I think that's crucial for quality control smile

#737 Re: mORMot 1 » Port in use » 2016-06-10 10:31:27

My approach: every time the program is being installed, it will first try to "delete" the url registration, then does the registration.

#738 Re: mORMot 1 » Memcached Boilerplate HTTP Server for Synopse mORMot Framework » 2016-06-09 15:43:36

It's defined as

 TBoilerplateHTTPServer = class(TSQLHttpServer)

I see now! Very useful features.

Just one more question - does it work under Linux?

#739 Re: mORMot 1 » Memcached Boilerplate HTTP Server for Synopse mORMot Framework » 2016-06-09 12:54:48

Thanks for sharing. Can  it be used with other html framework other than html 5 Boilerplate?

#740 Re: mORMot 1 » JSON RESTful web api from DataSnap to mORMot » 2016-06-08 07:59:08

Cool! Just an idea - add some benchmarking wink

#741 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-06-01 12:07:55

Yes, a download-and-ready-to-use Lazarus distribution with cross-compile feature would definitely greatly lower the barrier for people to built web services with FPC/mORMot.

I'm saying so because I know the difficulty wink

#742 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-06-01 11:41:26

@Maciej,

First, I appreciate and admire your contribution to FPC.

With respect, I would ask, is it really a good idea to change the language name? The bottom line is, the planned FPC fork should provide full backward compatibility for the official FPC.

Re. the website, I would strongly suggest to use github.io. Because you'll be able to collaborate on github.com, because, with respect, I assume github will generally last longer than other webistes smile But all after all, it'll be the decision you guys should make.

Re. installer, yes, I agree with you, I don't think it's worth to spend the time to make the installer script and compile for each release. We programmers should be able to deal with zip files smile

#743 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-06-01 07:53:32

@AOG,

I think just zip file would be enough, it's just like a so-called portable software, the one I downloaded from your Google drive was OK - as you definitely know, I have successfully configured it and compiled the mORMot MVC demo.

But it'll be ever better if people can exact it to any folder - I'm just saying, I can live with the current situation - it's in my C:\fpclazrtticross folder.

For the mORMot part, I would prefer to configure it myself, as I did, as long as we have a clear instruction online.

Just my 2 cents. Great work, you all!

#747 mORMot 1 » Linux VPS, tested EC2, Linode and vultr » 2016-05-20 09:50:48

edwinsn
Replies: 1

Hi AOG,

In one of previous post, you mentioned you are using the AWS t2.micro instance and are happy with it.

Today I spent sometime tested 3 price-comparable VPS (actully 3, but that's not for hosting) I own, all are using SSD, and it seems that the EC2 t2.micro instance has much lower disk IO rate.

I'm new to the cloud computing, and I'm wondering how that effects the overall performance...

The following is my benchmark result, using (https://github.com/mgutz/vpsbench), which is as easy as typing 2 lines of commands.

Note: More clear viewing of my result (screenshot): https://snag.gy/O9AwcV.jpg

vultr $5/month plan
```
CPU model: Virtual CPU 714389bda930
Number of cores: 1
CPU frequency: 2399.996 MHz
Total amount of RAM: 741 MB
Total amount of swap: 3999 MB
System uptime: 19 days, 13:19,
I/O speed: 398 MB/s
Bzip 25MB: 5.30s
Download 100MB file: 150MB/s
```



Linode $10/month plan
```
CPU model: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
Number of cores: 1
CPU frequency: 2799.992 MHz
Total amount of RAM: 991 MB
Total amount of swap: 255 MB
System uptime: 26 days, 19:30,
I/O speed: 572 MB/s
Bzip 25MB: 8.83s
Download 100MB file: 69.9MB/s
```

AWS EC2 t2.micro Approx. $13/month, first year free
```
CPU model: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
Number of cores: 1
CPU frequency: 2500.098 MHz
Total amount of RAM: 992 MB
Total amount of swap: 0 MB
System uptime: 30 min,
I/O speed: 63.2 MB/s
Bzip 25MB: 4.68s
Download 100MB file: 96.4MB/s
```

#748 Re: mORMot 1 » Windows Firewall Ports » 2016-05-19 06:39:55

Any info about if the AddApplicationToFirewall() function works under Windows 8/8.1/10?

#749 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-19 05:12:53

Well done AOG!

@ab, even under Delphi, isn't it only the global variables will be initialized, but not the local variables?

#750 Re: mORMot 1 » Authenticate from jscript » 2016-05-19 05:07:18

Please be note that "jscript' is not JavaScript nor JS smile

Board footer

Powered by FluxBB