You are not logged in.
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).
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.
Thanks Arnaud, will find sometime to look into your MVC design!
Inside Synopse.inc, do this:
Orig: {$MODE DELPHI} // e.g. for asm syntax
New: {.$MODE DELPHI} // e.g. for asm syntaxSo, 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 ![]()
I appreciate your great work all the same!
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
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.
@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.
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...
Hi Alfred, that's so great! amazing!
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?
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=26774But the restful orm works great!
Arnaud, I've got one new question, does the method-based interface work?
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 ![]()
Hi Arnaud, that's great! Thank you and Alf for the amazing work!
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)
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.
@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,.
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?
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.
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?
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
Thanks!
Sounds like if the main server was free while a thread was still running some process...
This is a very useful hint!
Thanks for the suggestion , ab. I'll investigate into it.
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.
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.MultiFieldValuesmpv, maybe I ask what cheap Windows hosting are you talking about? Last time ab suggested several...
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 ![]()
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.
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!
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
I should have done this and contribute back if I know Fossil well ![]()
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?
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 ![]()
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.
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".
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:
Great! It's obvious now ![]()
Hi Arnaud,
WE can disable the caching at the dabble level using TSQLDatabase.UseCache, but how to do the same with TSQLRestServer?
Thanks.
Arnaud, yes, you are right ![]()
Update 1: Downloaded the latest svn from github, the memory leaks are gone ![]()
@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.
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.
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!
ab, i need to do that because each thread must has its own log file.
Congratulations!It's one more step closer to the perfect world - the server supports Mac and Linux ![]()
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()
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..It just proves that our little rodent has some nice potential...
It's potential will be fully released once the Delphi compiler supports Linux ![]()
Yes, I know, I'm just sharing it here ![]()
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.
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.
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?
endHow? Your help will be appreciated!
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?
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;