#601 Re: mORMot 1 » Problem with TransactionBegin » 2014-05-03 09:24:18

Yes was using zip from 22.4.2014

#602 mORMot 1 » Problem with TransactionBegin » 2014-04-30 14:06:16

itSDS
Replies: 5

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.

#603 mORMot 1 » define array of RawUTF8 for RegisterCustomJSONSerializerFromText » 2014-04-30 13:54:35

itSDS
Replies: 7

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 ?

#604 mORMot 1 » BaaS Client for Rad Studio XE6 » 2014-04-24 15:15:44

itSDS
Replies: 1

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 ?

Board footer

Powered by FluxBB