#951 Re: mORMot 1 » Wow! Full FPC support now??!! » 2014-10-28 17:50:34

Thanks AGO, successfully built on Windows without static lib!

However, first run it complains missing libgcc_s_sjlj-1 so I got it from a subfolder inside the CodeTyphon directory. and of course I've got the latest sqlite3.dll from sqlite.org.

second run it emit this error:
Application could not start normally (0xc000007b), click ok to terminate the program. (translated from my native language).

#952 Re: mORMot 1 » Wow! Full FPC support now??!! » 2014-10-28 10:28:58

AOG wrote:

You are right !
Sorry about this ... sometimes I forget that I use my own compiler settings to get things running in my setup.

But, if you encounter this asm problem, you can solve it by adding the "assembler" statement to the declaration:
e.g. your line 315 SynLZO error:

function _lzo1x_1_do_compress(in_p: PAnsiChar; in_len: PtrInt;
  out_p: PAnsiChar; out out_len: integer): integer;
{$ifdef USEASM}
---------------> {$ifdef FPC} assembler;{$endif} <---------------

In FPC, pure assembler functions and procedures have to be defined by this "assembler" statement.
But if you set FPC into Delphi-mode, this is not necessary.

Hope this is clear.

Thanks! I got further.

- Suggest to allow defining the location for libkernel32.a and all otehr library files.

- where I can download the sqlite3.o and sqlite3fts3.o file? current I got:
TestMormotWin.lpr(23,1) Error: Undefined symbol: _sqlite3_close and a lot of similar errors.

thanks again.

#953 Re: mORMot 1 » MVC/MVVM Web Applications with mORMot! » 2014-10-28 07:01:57

Thanks Arnaud, will find sometime to look into your MVC design!

#954 Re: mORMot 1 » Wow! Full FPC support now??!! » 2014-10-28 06:58:41

AOG wrote:

Inside Synopse.inc, do this:

Orig: {$MODE DELPHI} // e.g. for asm syntax
New: {.$MODE DELPHI} // e.g. for asm syntax

So, place a dot in front of this define, to disable it !

Thanks Alfred, so I tried it again, under Windows I got:

D:\fpclibs\mORMot\SynLZO.pas(315,1) Fatal: Syntax error, "BEGIN" expected but "ASM" found

I'm new to FPC and at this stage I'm just trying out compiling mORMot with Lazarus, so I did not dig deeper, so this is a new bie question.

I suggest to include a .LPR project file that can be directly compiled with Lazarus under both Windows and Linux smile

I appreciate your great work all the same!

#955 Re: mORMot 1 » Wow! Full FPC support now??!! » 2014-10-25 11:54:13

Thanks Alfred.

I tried compiling the tests with Lazarus 1.2.6 under both Windows 7 and Ubuntu 14.4, I got the same error:

D:\fpclibs\mORMot\Synopse.inc(174,4) Error: Mode switch "DELPHI" not allowed here

#956 Re: mORMot 1 » Wow! Full FPC support now??!! » 2014-10-24 17:00:56

That's great! Actually, when compiling and running under Linux, which project file (I guess it's a .lpr file) does Alfred is talking about? I want to try it.

#957 Re: mORMot 1 » Wow! Full FPC support now??!! » 2014-10-22 15:22:40

@Alfred, Thanks for the info!

CodeTyphon never worked for me - maybe due to my Windows login contains non-ASCII characters - what a bad thing I've done when setting up my PC :<

And I voted that feature request about storing dynamic arrays in JSON in the DB.

#958 Re: mORMot 1 » Wow! Full FPC support now??!! » 2014-10-22 06:57:16

AOG wrote:

For me, I am very happy now being able to run full featured mORMot servers on small Linux hardware. Even ARM.


What's your FPC development setup? Do you develop on Windows or on Linux? If it's the latter, which version of Linux are you using? Last time I tried the latest Ubuntu 14 in a Virtualbox (on a quite decent Windows host), it's slow... I might  try Ubuntu 12 later...

#959 Re: mORMot 1 » Wow! Full FPC support now??!! » 2014-10-05 03:04:30

Hi Alfred, that's so great! amazing!

#960 Re: mORMot 1 » Wow! Full FPC support now??!! » 2014-10-04 14:50:27

Hi, thanks for the info.

If we write for Linux, do you think using Lazarus in Ubuntu in a VirtualBox is easier, or cross-compile from Windows?

#961 Re: mORMot 1 » Wow! Full FPC support now??!! » 2014-10-04 12:31:13

ab wrote:

This is a work in progress.

Not stable enough to be used on production yet.
But Alf did a lot of debugging to let the server compile on Linux with FPC.
We can thank him for his work!

We have one big issue with FPC which prevents to use interface based services.
See http://bugs.freepascal.org/view.php?id=26774

But the restful orm works great!
smile

Arnaud,  I've got one new question, does the method-based interface work?

#962 Re: mORMot 1 » Wow! Full FPC support now??!! » 2014-09-30 17:31:12

And I wish at the end somebody familiar with Lazarus can provide a step by step guide on cross-compiling for Linux on Windows - I can always hope, right smile

#963 Re: mORMot 1 » Wow! Full FPC support now??!! » 2014-09-30 17:20:21

Hi Arnaud, that's great! Thank you and Alf for the amazing work!

#964 mORMot 1 » Wow! Full FPC support now??!! » 2014-09-30 11:12:11

edwinsn
Replies: 77

So I was updating my local copy from the mORMot github repository (using SVN), and noticed just a hour ago, a commit stating this line:

FPC compilation under Linux ! - thanks Alf for the patches

I can't wait for Arnaud to explain in his blog on this Linux support! Does it mean I can write a web server for Linux now? What about Mac (I guess linux support will make it much easier to support Mac which is also from the *NIX family)

#965 Re: mORMot 1 » SynCommon.pas » 2014-09-28 10:32:14

While in a perfect world I wish this huge SynCommon.pas unit will be split into smaller modules (for a lot of good reasons), but I can easily live with its current statues. Aside from Ctrl+G MVP mentioned, you can also utilize the GREP search function of GExperts.

#966 Re: mORMot 1 » To store ms TDateTime » 2014-09-28 10:26:49

@ab, since we are on this, may I take this chance to ask, do you have any info on the comparison of performance between storing the TDateTime value as Iso8601 string (by default in mORMot) vs storing as Double?

By performance I mean querying performance, currently I use TDateTime fields (thus stored as Iso8601 strings in the sqlite3 db by default), and my query uses 'ORDER BY myDateField DESC' or something like that. I have noticed something the querying is slow, I'm wondering how many performance I will gain if I change my date time fields from TDateTime(Iso8601) to Double...

PS, I do have an index on the date time fields currently,.

#967 Re: mORMot 1 » Generating JavaScript Client? » 2014-09-28 10:21:02

Thanks for the info warleyalex.

I did a look at SmartMobileStudio.pas.mustache, looks like it can also generate SMS code for interface-based services, right? Anybody can confirm?

#968 Re: mORMot 1 » Generating JavaScript Client? » 2014-09-27 14:54:16

Not sure the readibility of the js code generated yb SMS's compiler, but that seems interesting.

If I'd ever done any research/works into this field, I'll share it in the forum.

#969 mORMot 1 » Generating JavaScript Client? » 2014-09-26 09:09:08

edwinsn
Replies: 4

Hi Arnaud,

Let's say we have some interface-based services, what would be the best way to wrap them into several JavaScript classes which can be run in the web browsers? From your blog post I see you can generate clients for SmartMobileStuidio using the Mustache template engine, is it possible (or how hard) to do that also for JS?

#970 Re: mORMot 1 » Need some insight on an 'Access Violation' in MainEngineList() » 2014-09-18 16:17:22

edwinsn wrote:
ab wrote:

Sounds like if the main server was free while a thread was still running some process...

This is a very useful hint!

ab, just to confirm that's the case smile Thanks!

#971 Re: mORMot 1 » Need some insight on an 'Access Violation' in MainEngineList() » 2014-09-18 05:54:13

ab wrote:

Sounds like if the main server was free while a thread was still running some process...

This is a very useful hint!

#972 Re: mORMot 1 » Need some insight on an 'Access Violation' in MainEngineList() » 2014-09-17 17:17:49

Thanks for the suggestion , ab. I'll investigate into it.

#973 Re: mORMot 1 » Need some insight on an 'Access Violation' in MainEngineList() » 2014-09-17 08:39:35

Arnaud, Thanks for the help, this is the first time I got this error from a user, I guess it happens very rare.

I'm using SVN 574, yes, it's multi-threading program. What "SQL tree" do you mean? The SQL being executed is a simple "SELECT" statement.

#974 mORMot 1 » Need some insight on an 'Access Violation' in MainEngineList() » 2014-09-17 06:07:52

edwinsn
Replies: 7

Hi Arnaud,

I got the following error report (and that's all I have now), from the stack traces the error is deep in SynSQLite3Static, not sure what's happening, any thoughts ?

operating system   : Windows 7 x64 Service Pack 1 build 7601
system language    : English
system up time     : 5 hours 49 minutes
program up time    : 1 minute 39 seconds
processors         : 4x Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
physical memory    : 4355/7990 MB (free/total)
free disk space    : (C:) 254.14 GB
display mode       : 1600x900, 32 bit
process id         : $32ac
allocated memory   : 78.25 MB
largest free block : 1.07 GB
compiled with      : Delphi XE4
madExcept version  : 4.0.10
callstack crc      : $e9cb975d, $f3a157ef, $83781afb
exception number   : 1
exception class    : EAccessViolation
exception message  : Access violation at address 0040895E in module 'MyProgram.exe'. Read of address 00000040.

thread $3a88 (TOmniThread):
0040895e MyProgram.exe System             191 TObject.Free
00409cfe MyProgram.exe System             191 @HandleFinallyInternal
7707b80d ntdll.dll                            RtlUnwind
7703012e ntdll.dll                            KiUserExceptionDispatcher
00409c86 MyProgram.exe System             191 @HandleFinally
7707b80d ntdll.dll                            RtlUnwind
7703012e ntdll.dll                            KiUserExceptionDispatcher
006da8a0 MyProgram.exe SynSQLite3Static  1379 sqlite3_value_numeric_type
006d3580 MyProgram.exe SynSQLite3Static  1379 sqlite3_result_value
006d36a6 MyProgram.exe SynSQLite3Static  1379 sqlite3_step
006b33bf MyProgram.exe SynSQLite3        4436 TSQLRequest.Step
006b2881 MyProgram.exe SynSQLite3        4175 TSQLRequest.Execute
009f8102 MyProgram.exe mORMotSQLite3     1053 TSQLRestServerDB.MainEngineList
007de723 MyProgram.exe mORMot           28783 TSQLRestServer.EngineList
007d09ec MyProgram.exe mORMot           24295 TSQLRest.ExecuteList
007cee34 MyProgram.exe mORMot           23667 TSQLRest.MultiFieldValues
007ceec8 MyProgram.exe mORMot           23673 TSQLRest.MultiFieldValues

#975 Re: mORMot 1 » mORMot on ARM (RaspberryPi/BBB) » 2014-09-08 18:49:45

mpv, maybe I ask what cheap Windows hosting are you talking about? Last time ab suggested several...

#976 Re: mORMot 1 » Can THttpServer.OnRequest() access the GUI? » 2014-09-08 03:24:21

Arnaud,

Update 1: Looks like example 22 - "JavaScript HTTPApi web server" can just server the static files perfectly, I should go from there! I check it out in depth.

---------------------------------------------------------------
I'm planning to use THTTPServer in LIVEditor, which is a live html and css editor  I mentioned earlier.

It's going to be a standard HTTP server - when the files the web browser requests are not loaded into the code editor yet, it just like a standard http server, but if the files are loaded into the code editor, it will return the real-time html/css content from the code editor.

I hope I explained my requirement clearly here smile

#977 mORMot 1 » Can THttpServer.OnRequest() access the GUI? » 2014-09-07 17:03:43

edwinsn
Replies: 2

Hi Arnaud,

With TSQLRestFullMemory, can can configure the methods to run in the main thread,

but with THttpServer, it's not clear to me, is THttpServer.OnRequest() by default runs in the main thread? Because in that method I need to access the GUI.

thanks.

#978 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-09-04 10:36:51

mpv wrote:

Controller and Debugger code still depend from my application so not ready yet for sharing (but we work on remove this dependency).

@mpv, that is a great news!

#979 Re: mORMot 1 » SynDb Explorer - Cannot execute multiple statements at a time? » 2014-08-22 15:13:36

ab, if you take a look at the buttons in the Windows standard 'Open File' dialog, there are enough spacing inside the borders and around the button caption, which provides "buffer" for the font size to grow, unless you set system DPI to some crazing value say 300%.

So it's very simple - use the form designer to make the buttons a little larger at design time smile I should have done this and contribute back if I know Fossil well smile

And taking about Fossil, can we use github to collaborate, in a future time I want to contribute something, which will benefit all, but are not a high priority in your list? I don't know github very well either, but I think it's workflow is quite straightforward - fork, checkout, change the code, submit and send a pull request to the master branch (ie your repository). I'm not sure if that will work for you?

#980 Re: mORMot 1 » SynDb Explorer - Cannot execute multiple statements at a time? » 2014-08-22 06:49:44

Just to clarify, I'm not suggesting the button size change because my own screen setting, but because the program doesn't fit various DPI settings allowed by the Windows system smile

I think the problem is that, by setting "Scaled := false", you by pass VCL's own scaling and allow the Window system to decide the font size, and Windows will consider my custom DPI setting, so the font sizes (40% larger) match my system. But since Windows doesn't decide the size for your buttons, if the buttons are designed too small, the font will overgrow.

#981 Re: mORMot 1 » SynDb Explorer - Cannot execute multiple statements at a time? » 2014-08-21 07:36:19

Arnaud,

Ok, I'll use the keyboard shortcuts.

Just a note: "Scaled := false" only solves the previous "font size problem", but not this "button size problem".

#982 mORMot 1 » SynDb Explorer - Cannot execute multiple statements at a time? » 2014-08-21 06:33:25

edwinsn
Replies: 7

Arnaud,

SynDb Explore, if you execute multile sql statements separated by commas, it'll run only the first statement. Eg:

delete from table1;
delete from table2;
delete from table3;

Another problem: The buttons need to be larger, check the screenshot:

http://screenpresso.com/=rJsob

#984 mORMot 1 » How to completely disable caching? » 2014-08-20 12:49:57

edwinsn
Replies: 2

Hi Arnaud,

WE can disable the caching at the dabble level using TSQLDatabase.UseCache, but how to do the same with TSQLRestServer?

Thanks.

#986 Re: mORMot 1 » Memory leaks in TSynLog? » 2014-08-15 18:41:01

Update 1: Downloaded the latest svn from github, the memory leaks are gone smile

#987 Re: mORMot 1 » mormot and LiveBindings » 2014-08-15 17:21:25

@lele9, just to clarify, it's not my experience but my own judgment based on what I have read and seen.

That's the code I'm talking about - overly complex. Just my two cents.

#988 Re: mORMot 1 » mormot and LiveBindings » 2014-08-15 14:23:02

I immediately decided I wouldn't use it when I saw the first demo of Live Bindings years ago when it first introduced - it uses a way too complex solution for the problem. And I heard performance issue with it.

#989 Re: mORMot 1 » Memory leaks in TSynLog? » 2014-08-13 07:31:12

Arnaud, it's a little more complex then that, - I also need to control the log file name, so that:
- I can load the most recent log entries the next time my program runs.
- Imagine my program has a concept called "profile" - I keep only one log file for each "profile" in my program.

Can I achieve that without using a derived class I mentioned above? Thanks!

#990 Re: mORMot 1 » Memory leaks in TSynLog? » 2014-08-13 03:33:33

ab, i need to do that because each thread must has its own log file.

#991 Re: mORMot 1 » Generates Cross-Platform mORMot Clients » 2014-08-12 06:10:08

Congratulations!It's one more step closer to the perfect world -  the server supports Mac and Linux smile

#992 Re: mORMot 1 » Memory leaks in TSynLog? » 2014-08-12 05:53:10

Ab, quite standard, except I use a derived class:
http://synopse.info/forum/viewtopic.php?id=1891

One thing came to my mind - I free the logger object manually, I not sure if that affects GarbageCollectorFreeAndNil()

#993 mORMot 1 » Memory leaks in TSynLog? » 2014-08-11 13:14:54

edwinsn
Replies: 10

I've got memory leaks in TSynLog, looks like the problem is from GarbageCollectorFreeAndNil()

The version I'm using: mORMot and Open Source friends 2014-07-16 0910

I assume My derived TSynLog class doesn't affect this?

stack traces by madExcept - I got a lot of entries like this:

allocation number: 38186
type: AnsiString
address: $b1e3318
size: 46
access rights: read/write
code page: 65001
reference counter: 1
string length: 32
contents: AllocNewSequentialFeedMediumPool

thread $17ec (TOmniThread):
671cb40a madExcept32.dll madExceptDbg          1500 GetMemCallback
00406a94 MyProgram.exe   System                4189 @GetMem
0040a6a7 MyProgram.exe   System               22313 @NewAnsiString
0040a8f2 MyProgram.exe   System               23046 @LStrFromPCharLen
0069e6a7 MyProgram.exe   SynCommons           39226 ReadSymbol
0069f69e MyProgram.exe   SynCommons           39461 LoadMab
0069f958 MyProgram.exe   SynCommons           39504 TSynMapFile.Create
006a20b4 MyProgram.exe   SynCommons           40802 TSynLog.LogFileHeader
0052b98a MyProgram.exe   System.Classes        6915 TStream.Seek
006a2e87 MyProgram.exe   SynCommons           40906 TSynLog.LogHeaderLock
006a349f MyProgram.exe   SynCommons           40999 TSynLog.LogInternal
006a1c69 MyProgram.exe   SynCommons           40697 TSynLog.Log

memory dump: 
0b1e3318  e9 fd 01 00 01 00 00 00 - 20 00 00 00 41 6c 6c 6f  ........ ...Allo
0b1e3328  63 4e 65 77 53 65 71 75 - 65 6e 74 69 61 6c 46 65  cNewSequentialFe
0b1e3338  65 64 4d 65 64 69 75 6d - 50 6f 6f 6c 00 00        edMediumPool..

#994 Re: mORMot 1 » deployd.com - Generate simple REST API with GUI » 2014-08-05 09:53:26

ab wrote:

It just proves that our little rodent has some nice potential...
smile

It's potential will be fully released once the Delphi compiler supports Linux smile

#996 mORMot 1 » deployd.com - Generate simple REST API with GUI » 2014-08-04 12:13:52

edwinsn
Replies: 6

Arnaud,

This node.js project is very interesting, should be very useful for people who don't need too complex backend:
http://deployd.com/

I's like a self-hosted version of parse.com - which has been very popular in recent years for mobile developers who want to store data into server but don't have experience/time to implement the backend.

#997 Re: mORMot 1 » Why the sqlite3 exceptions are eaten in TSQLRestServerDB.Commit? » 2014-07-31 04:05:10

Arnaud,

I am not limited to the last server log entry, what I want is to get notified when there is a database error and know where to look for the error messages that really tell the true problem.

#998 Re: mORMot 1 » Why the sqlite3 exceptions are eaten in TSQLRestServerDB.Commit? » 2014-07-30 15:05:20

Ok. So with the current implementation, what do you think to be the best way of getting the real sqlitedb errors? Like this?

if myRestServer.Add(...) < 1 then
beign
  GetTheLatestServerLogEntry() //how?
end

How? Your help will be appreciated!

#999 Re: mORMot 1 » Why the sqlite3 exceptions are eaten in TSQLRestServerDB.Commit? » 2014-07-30 10:17:43

ab wrote:
edwinsn wrote:

Is there an option to get over the currently forced logging and let us handle the errors?

Not at TSQLRest level.
Just at SynSQlite3 level.

So would you accept this as an option to disabled the logging and let us handle exceptions, at TSQLRest level?

#1000 mORMot 1 » SynDb Explorer - WITH statement example from the official SQLite site » 2014-07-30 07:23:34

edwinsn
Replies: 1

Arnaud,

This example, copied from http://sqlite.org/lang_with.html , when being run with syndb explorer, no results returned.

WITH RECURSIVE
  cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<1000000)
SELECT x FROM cnt;

Board footer

Powered by FluxBB