During this summer, warleyalex did meet some mORMots in the mountains of REST, Java, AJAX and JSON. (picture may differ from actual user:) ) He did some videos of his experiment with our little rodent. At this time, there are 11 videos available! Latest one is a Java client application, […]
Tag - ORM
2013-06-16
FireDAC / AnyDAC support for mORMot
2013-06-16. Open Source › mORMot Framework
Our SynDB classes feature now FireDAC / AnyDAC access, with full speed!
Up to now, only UniDAC, BDE or ZEOS components were available as source, but we just added FireDAC / AnyDAC.
FireDAC is an unique set of Universal Data Access Components for developing cross platform database applications on Delphi. This was in fact a third-party component set, bought by Embarcadero to DA-SOFT Technologies (formerly known as AnyDAC), and included with several editions of Delphi XE3 and up. This is the new official platform for high-speed database development in Delphi, in favor to the now deprecated DBExpress.
Our integration within SynDB.pas
units and the mORMot
persistence layer has been tuned. For instance, you can have direct access to
high-speed FireDAC Array DML feature, via the ORM batch process, via
so-called array
binding.
2013-04-24
mORMots know how to swim like fishes
2013-04-24. Open Source › mORMot Framework
Another great video by warleyalex. This time, a full FishFacts demo in AJAX, using mORMot and its SQLite3 ORM as server. See it on YouTube! Feedback is welcome on our forum. Update: I've just uploaded the corresponding source code to our repository. See sample 19 - AJAX ExtJS FishFacts. You need to […]
2013-04-02
Two videos about EXTjs client of mORMot server
2013-04-02. Open Source › mORMot Framework
Two nice videos, posted by a framework user. The first one presents a remote RESTful access of a SQLite3 database, hosted by a mORMot server: After one post in the forum, warleyalex was able to easily add remote filtering of the request: In addition to the previous video about security (by which the […]
2013-03-28
Adding some generic-based methods to mORMot
2013-03-28. Open Source › mORMot Framework
We have just added a TSQLTable.ToObjectList<T: class>() method. I want to add some generics-based methods to mORMot, for newer versions of Delphi. What do you think of it? Have you some method prototypes to propose? My first concern is that FreePascal does not offer the same syntax. I suppose […]
2013-03-27
Introducing TSQLTable.Step() method
2013-03-27. Open Source › mORMot Framework
We have just added TSQLTable.Step(), FieldBuffer()
and
Field()
methods, handling a cursor at TSQLTable
level, with optional late-binding column access.
It allows to retrieve results from a TSQLTable
/
TSQLTableJSON
result sets within a "cursor-like"
orientation.
That is, no need to specify the row number, but write a simple while
aList.Step do ...
loop.
Of course, you should better use TSQLRecord.FillPrepare
most of
the time, and access the data from a TSQLRecord
instance.
But it can be very useful, e.g. when working on a custom JOINed SQL
statement.
2013-03-23
Download latest version of sqlite3.dll for Windows 64 bit
2013-03-23. Open Source › mORMot Framework
Update: We now build the amalgamation file with mingw and release the latest version of SQLite3, from this direct SQLite3-64.7z link, as soon as it is published on the SQLite3 site. Up to now, there is no official Win64 version of the SQlite3 library released in http://sqlite.org.. It is in fact […]
2013-03-07
64 bit compatibility of mORMot units
2013-03-07. Open Source › mORMot Framework
I'm happy to announce that mORMot units are now compiling and working great in 64
bit mode, under Windows.
Need a Delphi XE2/XE3 compiler, of course!
ORM and services are now available in Win64, on both client and
server sides.
Low-level x64 assembler stubs have been created, tested and
optimized.
UI part is also available... that is grid display, reporting (with pdf
export and display anti-aliasing), ribbon auto-generation,
SynTaskDialog
, i18n... the main SynFile demo just works
great!
Overall impression is very positive, and speed is comparable to 32 bit version (only 10-15% slower).
Speed decrease seems to be mostly due to doubled pointer size, and some less
optimized part of the official Delphi RTL.
But since mORMot core uses its own set of functions (e.g. for
JSON serialization, RTTI support or interface calls or stubbing), we were able
to release the whole 64 bit power of your hardware.
Delphi 64 bit compiler sounds stable and efficient. Even when working at low
level, with assembler stubs.
Generated code sounds more optimized than the one emitted by
FreePascalCompiler - and RTL is very close to 32 bit mode.
Overall, VCL conversion worked as easily than a simple re-build.
Embarcadero's people did a great job for VCL Win64 support, here!
2013-02-17
Interface-based service sample: remote SQL access
2013-02-17. Open Source › mORMot Framework

You will find in the SQLite3\Sample\16 - Execute SQL via
services
folder of mORMot source code a Client-Server sample
able to access any external database via JSON and HTTP.
It is a good demonstration of how to use an interface-based service between
a client and a server.
It will also show how our SynDB
classes have a quite abstract
design, and are easy to work with, whatever database provider you need to
use.
The corresponding service contract has been defined:
TRemoteSQLEngine = (rseOleDB, rseODBC, rseOracle, rseSQlite3, rseJet, rseMSSQL);
IRemoteSQL = interface(IInvokable) ['{9A60C8ED-CEB2-4E09-87D4-4A16F496E5FE}'] procedure Connect(aEngine: TRemoteSQLEngine; const aServerName, aDatabaseName, aUserID, aPassWord: RawUTF8); function GetTableNames: TRawUTF8DynArray; function Execute(const aSQL: RawUTF8; aExpectResults, aExpanded: Boolean): RawJSON; end;
Purpose of this service is:
- To Connect()
to external databases, given the parameters of a
standard TSQLDBConnectionProperties. Create()
constructor;
- Retrieve all table names of this external database as a list;
- Execute any SQL statement, returning the content as JSON array, ready to be
consumed by AJAX applications (if aExpanded
is true
),
or a Delphi client (e.g. via a TSQLTableJSON
and the
mORMotUI
unit).
Of course, this service will be define as sicClientDriven
mode,
that is, the framework will be able to manage a client-driven
TSQLDBProperties
instance life time.
Benefit of this service is that no database connection is required on the
client side: a regular HTTP connection is enough.
No need to install nor configure any database provider, and full SQL access to
the remote databases.
Due to our optimized JSON serialization, it will probably be faster to work with such plain HTTP / JSON services, instead of a database connection through a VPN. In fact, database connections are made to work on a local network, and do not like high-latency connections, which are typical on the Internet.
2013-02-12
Introducing ZEOS, UniDAC, NexusDB, BDE, any TDataset to SynDB and mORMot's ORM
2013-02-12. Open Source › mORMot Framework

Up to now, our SynDB
database classes were handling
ODBC, OleDB providers and direct Oracle or
SQLite3 connection.
We have added a DB.pas
based layer, ready to be used with
UniDAC, NexusDB, or the BDE.
Any other TDataset
based component is ready to be interfaced,
including UIB, AnyDAC or DBExpress.
The ZEOS library (in its latest 7.0.3
stable version, which works from Delphi 7 up to XE3) has also been
interfaced, but without the TDataset
/DB.pas
layer:
our SynDBZEOS.pas
unit calls the ZDBC layer, which is not
tied to DB.pas
nor its RAD components, and is therefore
faster. By the way, it will work also with the Starter edition of
Delphi (which does not include the DB components) - just like the other
"regular" SynDB
classes.
This is a work in progress, any testing and feedback is welcome!
We had to circumvent some particularities of the libraries, but I guess we have
something interesting.
A dedicated "SynDBDataset" sub-folder has been created in the repository, to contain all
SynDBDataset.pas
-based database providers.
SynDBNexusDB.pas
unit has been moved within this sub-folder,
as SynDBUniDAC.pas
+ SynDBBDE.pas
units have
been added.
SynDBZeos.pas
has a direct access to the ZDBC layer, so
is not part of the "SynDBDataset" sub-folder.
Here is some benchmark, mainly about Oracle and
SQlite3 database access.
Of course, our direct SynDBOracle
/ SynDBSQLite3
layers are the fastest around, and we can see that ZDBC layer is sometimes more
efficient than the TDataset
components.
2013-02-03
Log to the console
2013-02-03. Open Source › mORMot Framework
Our framework features an integrated logging class, ready to be enabled for support and statistics.
For debugging purposes, it could be very handy to output the logging content
to a console window.
It enables interactive debugging of a Client-Server process, for instance: you
can interact with the Client, then look in real time at the server console
window, and inspect which requests are processed, without the need to open the
log file.
Depending on the events, colors will be used to write the corresponding information. Errors will be displayed as light red, for instance.
2013-01-28
External database speed improvements
2013-01-28. Open Source › mORMot Framework
Some major speed improvements have been made to our SynDB*
units, and how they are used within the mORMot persistence
layer.
It results in an amazing speed increase, in some cases.
Here are some of the optimizations how took place in the source code trunk:
- SQL statement client-side cache in ODBC and OleDB;
- SQL statement server-side cache for Oracle;
- When inserting individual data rows in an external table, the last inserted
IDs are maintained in memory instead of executing "select max(id)" -
we added a new property
EngineAddUseSelectMaxID
to unset this optimization - we noted that this modification circumvented a known limitation of Firebird very efficiently.
Overall, I observed from x2 to x10 performance boost with simple
Add()
operations, using ODBC, OleDB and direct Oracle access, when
compare to previous
benchmarks (which were already impressive).
BATCH
mode performance is less impacted, since it by-passed some of those
limitations, but even in this operation mode, there is some benefits
(especially with ODBC and OleDB).
Here are some results, directly generated by the supplied "15 - External DB performance" sample.
2013-01-27
Video about mORMot authentication
2013-01-27. Open Source › mORMot Framework
A new mORMot user notified on our forum that he just made a short video, about authentication and security with our framework, from the perspective of an AJAX Client. Many thanks for sharing your experiences! This video illustrate how RESTful authentication is implemented by mORMot. It compares also […]
2013-01-20
Adding JavaScript server-side support to mORMot
2013-01-20. Open Source › mORMot Framework
A long-time mORMot user and contributor just made a proposal on our
forums.
He did use mORMot classes to integrate a SpiderMonkey
JavaScript engine to our very
fast and scaling HTTP server, including our optimized JSON serialization
layer.
Today, he sent to me some of his source code, which sounds ready to be included in the main trunk!
This is a great contribution, and Pavel's goal is nothing less than
offering
Delphi based, FAST multithreaded server with ORM and node.js modules
compatible.
2013-01-05
Domain-Driven-Design and mORMot
2013-01-05. Open Source › mORMot Framework
Implementing Domain-Driven-Design (DDD) is one goal of our mORMot framework.
We already presented this particular n-Tier architecture.
It is now time to enter deeper into the material, provide some definition
and reference.
You can also search the web for reference, or look at the official web site.
A general
presentation of the corresponding concepts, in the .NET world, was used as
reference of this blog entry.
Stay tuned, and ride the mORMot!
2012-12-31
Enhance existing projects with mORMot
2012-12-31. Open Source › mORMot Framework

Even if mORMot will be more easily used in a project designed from scratch, it fits very well the purpose of evolving any existing Delphi project, or even creating the server side part of an AJAX application.
One benefit of such a framework is to facilitate the transition from a Client-Server architecture to a N-Tier layered pattern.
2012-11-28
Breaking change in mORmot: SQLite3*.pas units renamed mORMot*.pas
2012-11-28. Open Source › mORMot Framework
All former SQLite3\SQLite3*.pas units have been renamed to SQLite3\mORMot*.pas to match the database-agnostic scheme of the mORMot framework. This is a major break change, so all your "uses" clauses in your code is to be change to follow the new naming. See this commit, which includes […]
2012-10-28
SynDBOracle: Open Source native Oracle access
2012-10-28. Open Source › mORMot Framework

(this is an update of the article published in 2011/07)
For our mORMot framework, and in completion to our SynOleDB unit, we added a new Open Source unit, named SynDBOracle. It allows direct access to any remote Oracle server, using the Oracle Call Interface.
Oracle Call Interface (OCI) is the most comprehensive, high
performance, native unmanaged interface to the Oracle Database that exposes the
full power of the Oracle Database. We wrote a direct call of the
oci.dll
library, using our DB abstraction classes introduced for
SynOleDB.
We tried to implement all best-practice patterns detailed in the official Building High Performance Drivers for Oracle document
Resulting speed is quite impressive: for all requests, SynDBOracle is 3 to 5 times faster than a SynOleDB connection using the native OleDB Provider supplied by Oracle. We noted also that our implementation is 10 times faster than the one provided with ZEOS/ZDBC, which is far from optimized.
You can use the latest version of the Oracle Instant Client
provided by Oracle - see this
link - which allows you to run your applications without installing
the standard (huge) Oracle client or having an ORACLE_HOME
. Just
deliver the dll
files in the same directory than your application,
and it will work.
2012-10-18
Interfaces are not evil; or are Delphi-ers the new Vampires?
2012-10-18. Pascal Programming
A very interesting comment by mpv in our forum highlighted some points about potential interface (ab)use:
IMHO: Idea is good, but "the devil is in the details". To use mocking I must use interfaces. When I use interfaces I lost control on code, because I don't see implementation. Debugging an optimization became very hard. Especially if a beginner developer read something like GOF (Gang Of Four) and wherever necessary and where not use design templates like Visitor, Decorator and so on, and in debugging I don't understand at all what class actually implement passed interface. As for me, this is a biggest problem for .NET framework - developers use interfaces, don't look on implementation (and often don't have it in sources at all), do not learn by reading someone else's code and therefore produce monkey-code. This is only IMHO...
Could sounds rude, and like a trolling subject, but I perfectly understand
this point of view.
Introducing stubs and mocks
in mORMot was not the open door to all problems.. but,on the contrary,
to help write robust, efficient, and maintainable code.
It does not mean that using interfaces and C#/Java is the root of all evils and
code inefficiency, but that it may lead into problems.
2012-10-03
Today's sugar: "stored AS_UNIQUE" syntax
2012-10-03. Open Source › mORMot Framework
The limited RTTI available in earlier versions of Delphi we want to
support (starting with Delphi 6/7) lacks of attributes.
Even the attribute
feature of newer Delphi version is not
compatible with the one exposed by the FreePascalCompiler, we also
want to support.
Therefore, our ORM expects unique columns in a TSQLRecord
published property to be defined as stored false
.
It could be misleading at first, as reported by
several users.
In order to avoid any confusion, we just added a new constant named
AS_UNIQUE
.
« previous entries - page 4 of 7 - next entries »