You are not logged in.
Yes was using zip from 22.4.2014
Hi, i wrote one first Program for Mormot. The Task is easy copying data from one SQLite3 Table to mORMot ORM.
To speed it up i use TransactionBegin and BatchStart ...
examplecode in Client - App (Server is as Project Sample 04):
procedure AddTestRecord(const AField1, AField2, ... : String);
var
test : TSQLTestRecord;
id : integer;
begin
test := TSQLTestRecord.Create;
try
test.field1 := AField1;
test.field2 := AField2;
id := Database.Add(test, true);
finally
test.Free;
end;
end;
var
props: TSQLDBConnectionProperties;
I : ISQLDBRows;
G : Variant;
Results: TIntegerDynArray;
begin
if FileExists('source.db') then begin
props := TSQLDBSQLite3ConnectionProperties.Create(StringToUTF8('source.db'),'','','');
try
I := props.Execute('select * from sourcetable', [], @G);
if Database.TransactionBegin(TSQLTestRecord) then try
Database.BatchStart(TSQLTestRecord);
while I.Step do
AddTestRecord(G.field1, G.field2, ...);
Database.BatchSend(Results);
Database.Commit;
except
Database.RollBack;
end;
finally
props.Free;
end;
end;
end;On normal Processing everything works fine !
But i debugged the Program with the Debugger and if i abort the Program with (STRG+F2) in AddTestRecord, i had to restart the Serverapp before starting the client a second time because TransactionBegin failed.
So my Question: what should a client Program do if there is an unclosed Transaction (from another Session) on the ServerApp ?
In Praxis there could be an interrupt in Transmissiting Data from a client.
Hi, given the following packed record:
TTestComponentsJSON = packed record
name1, name2 : RawUTF8;
types : array of RawUTF8;
end;
TTest2JSON = packed record
test : array of TTestComponentsJSON;
end;
i have Problems to define the rtti - Text Const for the array of RawUTF8 !
__TTestJSON = 'test [name1 RawUTF8 name2 RawUTF8 types [array RawUTF8]]';
My Question: How i have to specify the array of RawUTF8 ?
I'm trying to create an IOS - App and found mORMot very interesting for this.
Since Delphi XE6 there is a new BaaS REST Api.
What do you think about creating a Backend for mORMot ?