You are not logged in.
OK, tried to build a newly created LCL blank project for arm/wince, using fpc/lazarus trunk, failed with this error:
"wincewsimglist.pp(94,17) Error: Identifier not found "TWinCEWSCustomImageList"
Will try to install (FPC 3.0.4 and Lazarus 1.6.4) later.
@AOG, Thanks! I'm using Windows.
Re. Win CE, it's still in the very earlier stage, but it's good to know the status, I appreciate it!
@AOG, I guess I found the wince problem you mentioned above: https://bugs.freepascal.org/view.php?id=33891
@AOG, great to hear that!
What's the wince problem, if I may ask? And does it mean that in order to compile sample 27 (lclclient), we cannot use the latest fpc/lazarus?
As far as I know, the cross-platform clients does not support **lazarus for wince**, is it right?
@macfly, I know you are objecting to a full-blown tool for generating a complete mORMot-based application, me too ![]()
On the other hand, a tool for creating a mORMot application skeleton might help, something like RoR's tool for generating the starting pieces of a mORMot app.
By the svn trunk I mean FPC and Lazarus, not mORMot.
Please google fpcupdeluxe.
Hi,
Why is the testql3 (mORMot 1.18.4620) compiled in Lazarus 1.8.4-Win64 giving such an effect?!?
d:\lazarus_testy\mormot\SQLite3>testsql3 Marked memory at $0000000005DC8150 invalid Wrong signature $E02CC5B3 instead of 15C0B663 $000000010001669D $00000001000168D4 $000000010001698F $000000010000ED9B $0000000100006EA6Michal
I used to see similar errors when compiled with one of the **stable** Lazarus release, try use the **trunk** svn version.
Hi again my friends.
I developed a POS/Sales management system that's in production completely based on mORMot, I must say mORMot is so flexible, so powerful and of high performance, and I'm glad that I have chosen sqlite as the db engine, apart from it's of high speed, it makes the deployment so easy, and it's so easy to get the db file from the client for any investigation.
The above mentioned system is the first software I started heavily using mORMot, and it only took me days before I started designing and writing the software, and once started, I meet new requirements and I consult the documentation, the samples or this forum.
Well, I consider I myself an experienced Delphi programmer, but really, it's not that hard, I promise you that you'll never regret using mORMot once you get familiar with it.
Here are some **step by step** advises for you. (Here I assume you are familiar with the windows system, have enough database system knowledge and have basic http/web concepts)
1- Make an ORM server first.
No mater how complex your system is, the basic operations will be CRUD, so I suggest you first make an ORM server running on the windows server first, you can achieve that by modifying the "04 HTTP Client-Server" sample, all you have to do is redefine the classes being persisted b mORMot. At this step, don't consider other DB system first.
2 - Make an ORM client on windows (later on we'll tough the mobile part).
Also can be done by modifying the above mentioned 04 sample folder.
With this client, you try to implement inserting, deleting, updating and reading the objects.
3 - implement a server-side API.
You can choose interface-based API or method-based, the later will be easier, and you can learn and modify the "Project06Server" sample. Try adjust the server-side function to be close to your real needs, for example, make the "signup" method.
4 - Although I highly highly highly recommend mORMot+sqlite, because basically mORMot is essentially has turned sqlite into a multi-user, client/server database system. But anyways, start from here, you might want to change the backend database system, and then make sure the ORM and server-side function still works.
5 - Make the mobile client.
Well, I don't use the mobile client, but you can look at the "27 - CrossPlatform Clients", sample, learn and try how to generate the cross-platform clients include FireMonkey, Smart Mobile Studio and FPC.
Once you generated, for example the firemonkey client, you can use the program you done in step 2 as the blueprint, make a FireMonkey program that connect to and consumes the very same server, and ensure the ORM and server-side function works.
6 -
Once you done the above steps, I'm sure you know how to implement your real application.
The rules are, step by step, start small, and bite them piece by piece.
I wrote it in a hurry, hope it helps.
The fact that the author of mORMot (ab) is very passionated, high productive, helpful, have a high interest in optimizing the code, and that his dedicated to the mORMot framework, and he's supported by a company that's using mORMot, plus that the mORMot has been so mature and versatile, apart from the learning curve, I'm confident that **you won't be able to find another better framework** than mORMot at the moment.
Bite them piece by piece. First try understand the official mOMRot samples, then you'll might have ideas on how to implement your requirements.
For your specific needs, I recommend learn the following samples step by step:
https://github.com/synopse/mORMot/tree/ … ent-Server
https://github.com/synopse/mORMot/tree/ … %20Service
https://github.com/synopse/mORMot/tree/ … 20services
As @pvn0 said, your question is too broad and you need to be specific if you want ** to be able to get help**
Hi ab,
Does TSQLTable/TSQLTableJSON has something like SearchFieldSorted or SearchFieldEquals, but supports multiple field values searching? Thanks.
Just like what mpv said, in the mORMot.pas file the garbled characters are only exists in the comments, so maybe it's not worth the change.
What puzzles me is that even I have converted both the SynTests.pas and SynSelfTests.pas files to utf8 encoding from ANSI encoding, when it runs the UTF8 part would still give me many errors, but still I'm using mORMot for years without noticeable errors ![]()
Hi ab,
the string constants cannot be displayed correctly on a Windows system that's using a non-ANSI compatible locales, see the screenshot showing the issue:
http://cloud.screenpresso.com/56Xtc/201 … ot.pas.png
I remember the running of mORMot test cases on my Chinese system will emit errors in the JSON testing part, I guess it might be related.
Thanks.
Validating UTF-8 strings using as little as 0.7 cycles per byte
Hi Maciej,
I had a quick look, and I'm sorry to hear that. All after all, I appreciate all of you for all your great works in the pascal community ![]()
@hnb,
What were you banned and can you point me to the page of the relative discussion?
Thanks the very helpful explanation, redevine!
And this statement is very **insightful**: "EWB is another product that could have been miles ahead if they'd focused on client-side functionality - but a lot of resource was spent building server-side functionality to help sell their database products. They should have just used mORMot :-)".
Starting with the official documentation is the wrong path.
Try start with the samples, for your specific needs, check https://github.com/synopse/mORMot/blob/ … Server.dpr
And this blog series: https://tamingthemormot.wordpress.com/
@rdevine,
I own FNC UI Pack too, but haven't start using it. I bought it to see it's Lazarus compatibility, although the drawing is not very top-notch, I'm OK with it's ability.
Would you elaborate a little about "...I'm careful to inherit-out my visual components..."? I myself want my new GUI programs to be able to **easily** to switch to Lazarus in the future with FNC Pack. thanks.
One the other hand, I still prefer EWB over SMS if (I mean, if) they are the only choices.
On the other hand, "pas2js (used in the front-end, which is the web browser) + Lazarus + mORMot" is **already** there, what's lacking is a UI widgets library similar to the TMS ones based on pas2js.
Sorry if I'm the one who's misunderstanding the conversation here.
I think you guys have some misunderstanding here, pas2js does integrate with Lazarus, pas2js is an integral part of FPC/Lazarus from the very begining, see (http://wiki.freepascal.org/lazarus_pas2js_integration) and here (http://wiki.freepascal.org/pas2js).
And I believe that TMS at the end would provide Tms Web Core support for Lazarus, because the FNC framework is already supporting Lazarus (I own a license).
@warleyalex, I'm not a lawyer, but I believe that if you completely implement all the code for your library, it's definitely legal.
@EMartin,
Oops! I missed that feature, thanks! I think it's enough for now.
@ab,
There are times some exceptions can be ignored, for example, sending an email on the server-side, we might want to catch the 'internet error' and re-try again later.
On the other hand, it'll fix the issue if EchoCustom can tell TSynLog to ignore a given log entry.
agreed.
@warleyalex,
I will the same about SMS although I haven't used it in deepth, but I watch the Delphi Facebook group, and I tried it earlier this year and the last year, it's cool, but it's not very stable and the document is lacking. On the other hand, I also tried Elevate Web Builder, it's looks much feature-complete and professional, and most importantly, it's very well documented.
I really have high hope on pas2js + TMS Web Core + FNC.
Do you know where to watch all the pas2js news?
Well, I think using IIS as a Reverse Proxy, via the Url Rewrite module, it's the most flexible and controllable way.
I don't think so, I guess FluxBB is a pure web-based forum software.
Try this url, which shows the recent forum posts only:
@guxinglei,
This Delphi wrapper for ChakraCore is much more updated and complete: https://github.com/tondrej/chakracore-delphi
@ab,
Sorry if I didn't make it clear - here I'm talking about the server side only. Like this:
function: TMyServerSideInterface.Method1: Integer;
begin
// Point A
try
// do something.
except // Point B
// ignore all exceptions here.
end;
end;But the engine still logs exceptions raised between Point A and Point B.
But IIS can bring a lot of benifits, for example, take use of the auto-config Let's Encrypt tools, and a lot of controls provided by IIS.
Hey! I've just found the BEST solution IMHO!
With the URL Rewrite v2 and Application Request Routing modules for IIS, you can achieve the following:
Assuming you have many mORMot servers listening on local ports, for example:
http://localhost:8081
http://localhost:8082
...
And your domain is www.mysite.com, and your IIS URL Rewrite map would be something like:
<rewrite>
<rules>
<rule name="Reverse Proxy to webmail" stopProcessing="true">
<match url="^client1/(.*)" />
<action type="Rewrite" url="http://localhost:8081/{R:1}" />
</rule>
<rule name="Reverse Proxy to payroll" stopProcessing="true">
<match url="^client2/(.*)" />
<action type="Rewrite" url="http://localhost:8082/{R:1}" />
</rule>
</rules>
</rewrite>And the result would be
All traffic to http://www.mysite.com/client1 will be redirected to http://localhost:8081, and
All traffic to http://www.mysite.com/client2 will be redirected to http://localhost:8082
Awesome, isn't it? I just tried on my Windows VPS with windows server 2016 (IIS 10).
Oh I almost forgot, here is the tuotrial.
Hi ab,
By default TSynLog automatically logs any exceptions raised and this is a nice feature, but I think it should ignore exceptions wrapped by any empty 'try...except' block. I guess it's a common practice to use a try...except block to "eat" some exceptions, for example:
try
// do something and if any exception raises just ignore them.
except
// ignore all exceptions here.
end;Thank you two gentlemen!
@igors233, that's more than enough for now ![]()
@ab,
Is it possible to obtain the requesting client's IP address and TSQLAuthUser instance, inside of an interface-based service method on the server side? Thanks.
I'm afraid of "classes explosion" (introduce too much classes) with DDD ![]()
On the other hand, even with DDD, your unit-of-work implementation is **on the ORM level** but not on the db engine level, right? So you need to use a global lock?
Some text for you from the author of sqlite:
...
Developers report that SQLite is often faster than a client/server SQL database engine in this scenario. Database requests are serialized by the server, so concurrency is not an issue. Concurrency is also improved by "database sharding": using separate database files for different subdomains. For example, the server might have a separate SQLite database for each user, so that the server can handle hundreds or thousands of simultaneous connections, but each SQLite database is only used by one connection.
@juwo,
if you expose port numbers other than 80/443 you probably will encounter firewall problems in the future, and it's known not to be a good (professional) practice.
@ab,
Where I can find the code example or documentation as to implementing:
....use a single domain name... then redirect the sub-URI to the (other) servers...without using reverse proxy...
?
Thanks!
Or how do you deal with such situation in a unit-of-work manner?
Currently my program checks for the new timestamp (TModTime) field of the target record **right before** sending the batch-update commands, but it's a separate network round trip and it's not inside a single 'transaction'.
Did you tried using 'bytes = (SELECT max(bytes) FROM tracks)'?
Recently I've been thinking the multiple database implementation with mORMot.
A solution
===
I guess the best option would be each mORMO-http server listens on local port, and let IIS/nginx reverse proxying sub-domains to the local servers.
For example, http://clienta.mycorp.com redirects to http://localhost:8001/root, and
http://clientb.mycorp.com redirects to http://localhost:8002/root
More thoughts
===
Actually the fact that with the current mORMot implementation, 'a http server can have multiple rest server', and since each 'rest server' can have their own 'root folder URI' and database, mORMot itself might already is a ground for implementing such functions, but I'm not sure.
@ab,
Suggestion
===
Would you consider adding a "aWhereClause: RawUtf8" parameter to the TSQLRestBatch.Update method? Some like:
function TSQLRestBatch.Update(Value: TSQLRecord; const CustomCSVFields: RawUTF8;
DoNotAutoComputeFields,ForceCacheUpdate: boolean; aWhereClause: RawUtf8 = ''): integer;When the rest server is executing the batch-update, it should generate the SQL like the one presented in the next section shown below, if the condition doesn't match, the update will failed.
Why?
===
As we know, the UPDATE statement supports the WHERE clause, and we can use it to avoid updating/overwriting an out-of-date record with the help of a time stamp field, something like:
UPDATE CustomerTable ..... WHERE CustomerTable.LastModTime = "theValueRetrievedWhenReading"...I wish I'm clear on this ![]()
I use the URL Rewrite IIS module, I guess it's more flexible.
Follow this tutorial and it's very easy: https://tecadmin.net/set-up-reverse-proxy-using-iis/
@mpv,
Good point, it makes sense. Currently I use Windows only (so far).
Or maybe a better suggestion would be add a new parameter to TTextWriter.Create, so that it looks like:
TTextWriter.Create(aStream: TStream; aSaveUtf8BOM: Boolean);
And transparently handle the adding the utf8 BOM before writing the first byte of the text writer data to aStream.
Imagine people don't know nothing about utf8 encoding and the so-called BOM. Actually, I took me several tens of minutes of searching before I know Excel assumes utf8-without-BOM as ANSI text.
It's your call ![]()
@Leslie,
The old backup API does save the entire db data including the indexes either, it's the same in this regard. Not sure how to exclude the indexes...
@ab,
Would you consider adding the following simple function to TTextWriter?
Assume you use TTextWriter to generate csv files, chaining a TFileStream instance to the text writer when creating it, and finally you call FlushFinal to write the content to the disk.
But since BOM is missing from the final file but Excel relies on the BOM to detect utf8 encoding, all CJK (maybe all non-English) characters will be shown as garbled characters inside Excel.
function TTextWriter.AddUtf8BOMAtBeginning: Boolean;
begin
if GetLength < 1 then
begin
AddShort(#$ef#$bb#$bf); // add UTF-8 Byte Order Mark
Result := True;
end
else
Result := False;
end;I guess so, check https://synopse.info/forum/viewtopic.php?id=4478 which mentions the newly added sqlite feature https://www.sqlite.org/c3ref/serialize.html
OK, right after posting the question, I found the answer:
Form1.Database := TSQLHttpClientWinHTTP.Create('server.mysite.com','443', Form1.Model, True); // ok! it's httpS!Hope it helps for somebody else ![]()
But I guess the global NewSQLHttpClient function still has the Access Violation issue.