You are not logged in.
Pages: 1
Arnaud, I'll use pure Indy instead of Datasnap for now. For this project I don't need scalability.
A Windows Service TCP Server;
A Firemonkey iOS TCP Client;
The client sends a function to the server;
The server opens a connection to database, execute a query using TDatasetProvider+TClientDataset, save to stream, compress the stream using TZCompressionStream and send back to client, close the TClientDataset;
The client receives the stream, decompress it, opens a TClientDataset from stream without a provider. I save to disk if the table is big enough and doesn't change much.
It works a lot better than DataSnap and is stateless.
Maybe in the future I try mormot in projects that need it.
Thank you!
Bruno
With SMS/HTML5 the app runs stateless?
DataSnap is very heavy for mobile. Sometimes it slows down and a simple call to a remote procedure that executes a stored procedure takes seconds.
Thank you Arnaud!
Bruno
Arnaud, can you tell me the steps to convert a DataSnap application to mormot? I already downloaded your thousand pages pdf but i'm still confused.
At first, it seems that remobjects and realthinclient are easier for me to convert. But I want to use mormot because I have others bigger projects too.
This small project I want to convert is already running and consists of:
DB: Sql Server Database - Will not be changed
Client: Windows Application (Delphi using ADO) - Will not be converted to mormot because is used via LAN
Server: Windows Service Application (Delphi using dbexpress and datasnap) - Will be converted to mormot
Client: FireMonkey iOS Application (Delphi using datasnap) - Will need changes to connect to mormot and discard datasnap
Currently, the firemonkey ios app downloads a "one time load" (or when really needed, per week or month) via datasnap some tables that are not changed much, one has 9000 records (700kb). After configuring server, port, user and password. I save this to binary cds files in the ios app folder.
1) The ios app connects to datasnap server;
2) Call the datasetprovider that is connected to a tsqlquery via a clientdataset;
3) Open the clientdataset;
4) Save the clientdataset to disk (binary);
5) Close the clientdataset;
6) Close the datasnap connection to server (stateless).
Repeat the four steps to each table.
When I need, I call ClientDataSetX.LoadFromFile and show the table to the user, offline. No datasnap connections required here to perfom better.
Then, some operations in the ios app need a call to a method declared in the datasnap server using a TSqlServerMethod component. The method in the server runs a stored procedure to include a record in the table like:
In the server:
function TServerMethods1.IncludeDevLoja(Data: TDateTime; CodCaixa: string;
Quantidade: integer; out Ret: string): boolean;
var
Trans: TDBXTransaction;
begin
result := false;
ret := '';
Trans := dbconn.BeginTransaction;
try
if SpCxIncluirDevLoja.Active then SpCxIncluirDevLoja.Close;
SpCxIncluirDevLoja.Params.ParamByName('@Data').AsDateTime := Data; // date
SpCxIncluirDevLoja.Params.ParamByName('@CodCaixa').AsString := CodCaixa; // code
SpCxIncluirDevLoja.Params.ParamByName('@Quantidade').AsInteger := Quantidade; // quantity
SpCxIncluirDevLoja.Prepared := true;
SpCxIncluirDevLoja.ExecProc;
dbconn.CommitFreeAndNil(Trans);
result := true;
ret := 'Devolução de Loja incluída com sucesso.'; // success
except
on E: exception do
begin
DoLog('Function IncludeDevLoja. ' + E.Message,ltError);
ret := E.Message;
dbconn.RollbackFreeAndNil(Trans);
end;
end;
end;
I run the method and disconnect from the datasnap server (stateless).
But using 3G datasnap performs really bad.
This is my scenario.
Can you help?
What are the correct steps to successfully convert to mormot?
What would you do?
Thank you!
Bruno
Thank you!
I'll take a look.
Good luck!
Bruno
Hi!
Do you have any plans to support FireMonkey iOS?
I think this is a big market and DataSnap performs really bad over slow connections (3G). For lots of data and users it's impraticable.
FireMonkey is an easy option to pick if you want to build nice multitiered database applications for iOS. But DataSnap is not.
Other options are RemObjects and RealThinClient.
Thank you!
Bruno
Pages: 1