#501 Re: mORMot 1 » Problem with nested Records for Interfaces. » 2014-12-08 21:46:51

Hi AB i found the solution:

i have to add this at the bottom.

  __TResultRecord =
  'resultRec { erfolgJN RawUtf8 fehlertext RawUtf8 hinweistext RawUtf8} FResult1 RawUtf8 FResult2 RawUtf8 FResult3 RawUtf8 FResult4 RawUtf8';

initialization
  TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TResultRecord),__TResultRecord);

But how can i reuse a record not directly used as Interface function Result ?

   TResult : record
      erfolgJN : RawUtf8;
      fehlertext : RawUtf8;
      hinweistext : RawUtf8;
    end;

 TResultRecord1 = record
    resultRec : TResult;
    FResult1 : RawUtf8;
    FResult2 : RawUtf8;
    FResult3 : RawUtf8;
    FResult4 : RawUtf8;
  end;

 TResultRecord2 = record
    resultRec : TResult;
    FResult1 : RawUtf8;
    FResult2 : RawUtf8;
  end;

in this case TResult is not defined in the Wrapper Client.

#502 mORMot 1 » Problem with nested Records for Interfaces. » 2014-12-08 20:28:21

itSDS
Replies: 2

XE7 Upd1:

the following Deklaration

  TResultRecord = record
    F : record
      erfolgJN : RawUtf8;
      fehlertext : RawUtf8;
      hinweistext : RawUtf8;
    end;
    FResult1 : RawUtf8;
    FResult2 : RawUtf8;
    FResult3 : RawUtf8;
    FResult4 : RawUtf8;
  end;

results in generated wrapper code:

  TResultRecord = record
    F: :TResultRecord.:1;
    FResult1: string;
    FResult2: string;
    FResult3: string;
    FResult4: string;
  end;

#503 Re: mORMot 1 » Problem with record as Result at Interface function » 2014-12-06 10:30:52

Hi AB i found out that the type RawJSON does not work in the record. I replaced it with RawUtf8 and no error occures.

#504 Re: mORMot 1 » Problem with record as Result at Interface function » 2014-12-06 01:11:33

I use XE7, very serious is the Result - Handling in the Debugger on the server - code.
Normal RawJSON - Results without record work as expected

#505 mORMot 1 » Problem with record as Result at Interface function » 2014-12-05 14:17:39

itSDS
Replies: 3

Hi AB,

I'm enhancing my Interface Stuff an liked to create the following function:

  RDetails = record
    FResult1 : RawJSON;
    FResult2 : RawJSON; 
    FResult3 : RawJSON;
    FResult4 : RawJSON;
  end;

  function Testfunction1(const AIDs : RawJSON) : RDetails;

  function Testfunction2(const AIDs : RawJSON; var ADetails : RDetails) : RawJSON;

The Server runs and the CrossplatformClient with generated wrapper also

But the client does not receive the Result

with Testfunction1 Error  received 0 parameters (expected 1)
with Testfunction2 Error  received 0 parameters (expected 2)

What is wrong ?

#506 Re: mORMot 1 » Missing RowCount in TJSONTable / TJSONTableObject » 2014-12-05 12:31:06

TY, i took the first one. But Have one Problem with SeekFirst

Your code should read:

n := 0;
while table.Step(n=0) do inc(n); 

or

n := 0;
bSeekFirst := true;
while table.Step(bSeekFirst) do begin
  inc(n); 
  bSeekFirst := false;
end;

cause normally you have to SeekFirst smile

Could there be an more elegant way to do the SeekFirst ?

Normally in Delphi you do something like:

table.First
while not table.eof do
  table.Next;
end;

Both Versions hae their Advantages.

#507 Re: mORMot 1 » delphi question Dynamic Params for Execute » 2014-12-05 12:18:28

TYVM

Sometimes i have a board in front of the head.

#508 mORMot 1 » Missing RowCount in TJSONTable / TJSONTableObject » 2014-12-04 16:30:39

itSDS
Replies: 3

Hi AB,
if i use nonExpanded Format, the Last Value is RowCount.

ATM i'm missing this Property in TJSONTable.
or is it fast enough to use

JSONVariant(JSON).rowCount

#509 Re: mORMot 1 » delphi question Dynamic Params for Execute » 2014-12-04 14:21:01

May be i found the solution. But it looks very complicated ?!

function Getxyz(cinst AStatus : RawJSON) : RawJSON;
var
  Stmt : ISQLDBRows;
  LAStatus : array of TVarRec;
  LVStatus : variant;
  i : integer;
  sFragezeichen : RawUtf8;
begin
    LVStatus := _JsonFast(AStatus);
    SetLength(LAStatus, DocVariantData(LVStatus).Count);
    sFragezeichen := '';
    for i := 0 to DocVariantData(LVStatus).Count-1 do begin
      if Length(sFragezeichen) > 0 then
        sFragezeichen := sFragezeichen + ',';
      VariantToVarRec(DocVariantData(LVStatus).Values[i], LAStatus[i]);
      sFragezeichen := sFragezeichen + '?';
    end;
    Stmt := Connection.Execute('select * from tabelle where status in (' + sFragezeichen + ')', LAStatus);
    exit(Stmt.FetchAllAsJSON(false));
end;

is there an easier way ?

#510 mORMot 1 » delphi question Dynamic Params for Execute » 2014-12-04 13:31:08

itSDS
Replies: 3

Hi AB i have a delphi question i can not solve by myself:

I'm writing an interface with Mormot. One Param is RawJSON containing an array auf Strings.
I wan't to give the Strings of this array as Params to:

TSQLDBConnectionProperties.Execute(const aSQL: RawUTF8; const Params: array of const

so i have to create an dynamic array of const and add some RawUtf8 Values to it.
But i dont' know how to do this ?!

var
  pArray : array of const; // does not work
  pArray : TVarRec;  // does
begin
  Connection.Execute('select * from tabelle where id in [?,?,?,?]', pArray)

the ? are generated for every array item.

Can you help me how to code this ?

#511 mORMot 1 » Little Compilererror XE7 and mormot.pas » 2014-11-29 09:20:27

itSDS
Replies: 1

Hi AB there is a liitle Problem with mORMot.pas line 9414

    procedure InternalLog(Format: PWinAnsiChar; const Args: array of const;
      Level: TSynLogInfo); overload;
      {$ifdef HASINLINE}inline;{$endif}
    /// internal method used by Delete(Table,SQLWhere) method

this procedure cannot be inline cause it has array of const as param.

My Work around: I documented Inline out smile

#512 mORMot 1 » Indexname generation causes every time Index generation » 2014-11-29 09:09:50

itSDS
Replies: 1

Hi AB,
i found a little Bug in your Index - Name generation if IndexName Length > 27 Chars.

I create a unique index in InitializeTable. The Tablename and the Fieldname together is longer than 40 chars.
Everytime i start my Program a new Index is generated.

The Reason is that the Indexname is different every time !

I saw in your name generation that you append a tickcount - may be that's the reason why.
The Idea to generate a Unique ID from the names sounds accectable.

My private idea is:
Can you modify the Indexname Generation depending on the Database Type ?
Some Databases support Indexnames longer than 32 chars (Seems to be an outdated limit coming from former times i think)
I remember the old btrieve day's on novell.

ATM i specify the IndexName on my own. But there i have a problem with an Index i create for derived Classes. In that case i have to generate a unique Index Name in the parent class else it will not be created:

class procedure TSQLDFExampleTableReferenzRecord.InitializeTable(Server: TSQLRestServer; const FieldName: RawUTF8; Options: TSQLInitializeTableOptions);
begin
  if (FieldName = '') or (FieldName = 'LID') then
    Server.CreateSQLIndex(Self, 'Fieldname', false, 'IDX' + Self.ClassName.Substring(4, Self.Classname.Length - 10)+'Fieldname');   
end;

here i would like to use '' as indexname but like also to get a readable Indexname.

#513 Re: mORMot 1 » net stop service takes 60s » 2014-11-27 08:59:55

Hi AB i found the reason for the Exception in our code.
The only thing i need is to disable the MessageBox if it runs as service.

Maybe anyone has an idea.

#514 Re: mORMot 1 » net stop service takes 60s » 2014-11-27 08:42:27

Hi AB i had a look at the Server and found out something new:

i started the service in console Mode. After pressing ENTER to stop it an exception Messagebox comes onto the Screen showing the Exception Number.

I think this MessageBox comes also in the Service code.
cause no screen interaction is allowed, it is not shown.
The OS kills the Process after 60s.

What do you think

Is it possible to disable this MessageBox ?

#515 Re: mORMot 1 » net stop service takes 60s » 2014-11-27 08:40:20

Hi AB i checked the Log and found the line above, so i'm right to suppose I'm using http.sys ?

here the shutdown code of the log (I replaced the real server names with s1-s8):

09:31:14	Info	1	    TDFCloudService(0000000001354F70) DFCloud: command 4 received from OS
09:31:14	Leave	1	 00.000.291
09:31:14	Enter	1	 TDFCloudService(0000000001354F70).00000000006976A3 
09:31:14	Info	1	    TDFCloudService(0000000001354F70) DFCloud: command 1 received from OS
09:31:14	Info	1	    TDFCloudService(0000000001354F70) DFCloud ReportStatus(Stopping,0,0)
09:31:14	Enter	1	    TDFCloudService(0000000001354F70).0000000000A7E16F 
09:31:14	Info	1	       Server {"THttpApiServer(00000000012F8E00)":{"Cloned":false,"RegisteredUrl":"http://+:5001/s1/,http://+:5001/s2/,http://+:5001/s3/,http://+:5001/s4/,http://+:5001/s5/,http://+:5001/s6/,http://+:5001/s7/,http://+:5001/s8/,http://+:5001/","HTTPQueueLength":1000,"MaxBandwidth":-1,"MaxConnections":-1,"APIVersion":"HTTP API 2.0"}} gestoppt durch {"TSQLHttpServer(00000000013FFFA0)":{}}
09:31:14	Enter	1	       TSQLHttpServer(00000000013FFFA0).00000000006C8088 
09:31:14	Info	1	          TSQLHttpServer(00000000013FFFA0) {"THttpApiServer(00000000012F8E00)":{"Cloned":false,"RegisteredUrl":"http://+:5001/s1/,http://+:5001/s2/,http://+:5001/s3/,http://+:5001/s4/,http://+:5001/s5/,http://+:5001/s6/,http://+:5001/s7/,http://+:5001/s8/,http://+:5001/","HTTPQueueLength":1000,"MaxBandwidth":-1,"MaxConnections":-1,"APIVersion":"HTTP API 2.0"}} finalized for 8 server(s)
09:31:14	Trace	25	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4012 ThreadCount=31
09:31:14	Trace	25	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4012 ThreadCount=31
09:31:14	Trace	25	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4012 ThreadCount=31
09:31:14	Trace	25	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4012 ThreadCount=31
09:31:14	Trace	25	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4012 ThreadCount=31
09:31:14	Trace	25	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4012 ThreadCount=31
09:31:14	Trace	25	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4012 ThreadCount=31
09:31:14	Trace	25	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4012 ThreadCount=31
09:31:14	Trace	28	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2436 ThreadCount=30
09:31:14	Trace	28	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2436 ThreadCount=30
09:31:14	Trace	28	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2436 ThreadCount=30
09:31:14	Trace	28	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2436 ThreadCount=30
09:31:14	Trace	28	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2436 ThreadCount=30
09:31:14	Trace	28	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2436 ThreadCount=30
09:31:14	Trace	28	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2436 ThreadCount=30
09:31:14	Trace	28	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2436 ThreadCount=30
09:31:14	Trace	11	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2948 ThreadCount=29
09:31:14	Trace	11	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2948 ThreadCount=29
09:31:14	Trace	11	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2948 ThreadCount=29
09:31:14	Trace	11	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2948 ThreadCount=29
09:31:14	Trace	11	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2948 ThreadCount=29
09:31:14	Trace	11	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2948 ThreadCount=29
09:31:14	Trace	11	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2948 ThreadCount=29
09:31:14	Trace	11	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2948 ThreadCount=29
09:31:14	Trace	7	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3464 ThreadCount=28
09:31:14	Trace	7	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3464 ThreadCount=28
09:31:14	Trace	7	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3464 ThreadCount=28
09:31:14	Trace	7	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3464 ThreadCount=28
09:31:14	Trace	7	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3464 ThreadCount=28
09:31:14	Trace	7	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3464 ThreadCount=28
09:31:14	Trace	7	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3464 ThreadCount=28
09:31:14	Trace	7	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3464 ThreadCount=28
09:31:14	Trace	5	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1408 ThreadCount=27
09:31:14	Trace	5	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1408 ThreadCount=27
09:31:14	Trace	5	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1408 ThreadCount=27
09:31:14	Trace	5	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1408 ThreadCount=27
09:31:14	Trace	5	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1408 ThreadCount=27
09:31:14	Trace	5	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1408 ThreadCount=27
09:31:14	Trace	5	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1408 ThreadCount=27
09:31:14	Trace	5	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1408 ThreadCount=27
09:31:14	Trace	4	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3544 ThreadCount=26
09:31:14	Trace	4	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3544 ThreadCount=26
09:31:14	Trace	4	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3544 ThreadCount=26
09:31:14	Trace	4	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3544 ThreadCount=26
09:31:14	Trace	4	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3544 ThreadCount=26
09:31:14	Trace	4	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3544 ThreadCount=26
09:31:14	Trace	4	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3544 ThreadCount=26
09:31:14	Trace	4	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3544 ThreadCount=26
09:31:14	Trace	34	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1768 ThreadCount=25
09:31:14	Trace	34	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1768 ThreadCount=25
09:31:14	Trace	34	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1768 ThreadCount=25
09:31:14	Trace	34	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1768 ThreadCount=25
09:31:14	Trace	34	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1768 ThreadCount=25
09:31:14	Trace	34	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1768 ThreadCount=25
09:31:14	Trace	34	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1768 ThreadCount=25
09:31:14	Trace	34	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1768 ThreadCount=25
09:31:14	Trace	24	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2604 ThreadCount=24
09:31:14	Trace	24	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2604 ThreadCount=24
09:31:14	Trace	24	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2604 ThreadCount=24
09:31:14	Trace	24	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2604 ThreadCount=24
09:31:14	Trace	24	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2604 ThreadCount=24
09:31:14	Trace	24	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2604 ThreadCount=24
09:31:14	Trace	24	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2604 ThreadCount=24
09:31:14	Trace	24	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2604 ThreadCount=24
09:31:14	Trace	23	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1380 ThreadCount=23
09:31:14	Trace	23	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1380 ThreadCount=23
09:31:14	Trace	23	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1380 ThreadCount=23
09:31:14	Trace	23	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1380 ThreadCount=23
09:31:14	Trace	23	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1380 ThreadCount=23
09:31:14	Trace	23	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1380 ThreadCount=23
09:31:14	Trace	23	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1380 ThreadCount=23
09:31:14	Trace	23	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1380 ThreadCount=23
09:31:14	Trace	21	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3868 ThreadCount=22
09:31:14	Trace	21	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3868 ThreadCount=22
09:31:14	Trace	21	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3868 ThreadCount=22
09:31:14	Trace	21	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3868 ThreadCount=22
09:31:14	Trace	21	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3868 ThreadCount=22
09:31:14	Trace	21	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3868 ThreadCount=22
09:31:14	Trace	21	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3868 ThreadCount=22
09:31:14	Trace	21	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3868 ThreadCount=22
09:31:14	Trace	17	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4068 ThreadCount=21
09:31:14	Trace	17	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4068 ThreadCount=21
09:31:14	Trace	17	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4068 ThreadCount=21
09:31:14	Trace	17	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4068 ThreadCount=21
09:31:14	Trace	17	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4068 ThreadCount=21
09:31:14	Trace	17	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4068 ThreadCount=21
09:31:14	Trace	17	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4068 ThreadCount=21
09:31:14	Trace	17	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4068 ThreadCount=21
09:31:14	Trace	20	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1516 ThreadCount=20
09:31:14	Trace	20	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1516 ThreadCount=20
09:31:14	Trace	20	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1516 ThreadCount=20
09:31:14	Trace	20	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1516 ThreadCount=20
09:31:14	Trace	20	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1516 ThreadCount=20
09:31:14	Trace	20	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1516 ThreadCount=20
09:31:14	Trace	20	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1516 ThreadCount=20
09:31:14	Trace	20	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1516 ThreadCount=20
09:31:14	Trace	26	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1180 ThreadCount=19
09:31:14	Trace	26	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1180 ThreadCount=19
09:31:14	Trace	26	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1180 ThreadCount=19
09:31:14	Trace	26	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1180 ThreadCount=19
09:31:14	Trace	26	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1180 ThreadCount=19
09:31:14	Trace	26	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1180 ThreadCount=19
09:31:14	Trace	26	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1180 ThreadCount=19
09:31:14	Trace	26	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1180 ThreadCount=19
09:31:14	Trace	19	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4040 ThreadCount=18
09:31:14	Trace	19	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4040 ThreadCount=18
09:31:14	Trace	19	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4040 ThreadCount=18
09:31:14	Trace	19	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4040 ThreadCount=18
09:31:14	Trace	19	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4040 ThreadCount=18
09:31:14	Trace	19	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4040 ThreadCount=18
09:31:14	Trace	19	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4040 ThreadCount=18
09:31:14	Trace	32	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3400 ThreadCount=17
09:31:14	Trace	32	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3400 ThreadCount=17
09:31:14	Trace	32	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3400 ThreadCount=17
09:31:14	Trace	32	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3400 ThreadCount=17
09:31:14	Trace	32	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3400 ThreadCount=17
09:31:14	Trace	32	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3400 ThreadCount=17
09:31:14	Trace	19	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=4040 ThreadCount=18
09:31:14	Trace	32	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3400 ThreadCount=17
09:31:14	Trace	32	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3400 ThreadCount=17
09:31:14	Trace	18	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3816 ThreadCount=16
09:31:14	Trace	18	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3816 ThreadCount=16
09:31:14	Trace	18	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3816 ThreadCount=16
09:31:14	Trace	18	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3816 ThreadCount=16
09:31:14	Trace	18	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3816 ThreadCount=16
09:31:14	Trace	18	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3816 ThreadCount=16
09:31:14	Trace	18	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3816 ThreadCount=16
09:31:14	Trace	18	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3816 ThreadCount=16
09:31:14	Trace	13	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1364 ThreadCount=15
09:31:14	Trace	13	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1364 ThreadCount=15
09:31:14	Trace	13	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1364 ThreadCount=15
09:31:14	Trace	13	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1364 ThreadCount=15
09:31:14	Trace	13	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1364 ThreadCount=15
09:31:14	Trace	13	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1364 ThreadCount=15
09:31:14	Trace	13	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1364 ThreadCount=15
09:31:14	Trace	13	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1364 ThreadCount=15
09:31:14	Trace	30	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2344 ThreadCount=14
09:31:14	Trace	30	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2344 ThreadCount=14
09:31:14	Trace	30	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2344 ThreadCount=14
09:31:14	Trace	30	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2344 ThreadCount=14
09:31:14	Trace	30	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2344 ThreadCount=14
09:31:14	Trace	30	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2344 ThreadCount=14
09:31:14	Trace	30	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2344 ThreadCount=14
09:31:14	Trace	30	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2344 ThreadCount=14
09:31:14	Trace	12	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3452 ThreadCount=13
09:31:14	Trace	12	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3452 ThreadCount=13
09:31:14	Trace	12	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3452 ThreadCount=13
09:31:14	Trace	12	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3452 ThreadCount=13
09:31:14	Trace	12	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3452 ThreadCount=13
09:31:14	Trace	12	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3452 ThreadCount=13
09:31:14	Trace	12	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3452 ThreadCount=13
09:31:14	Trace	12	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3452 ThreadCount=13
09:31:14	Trace	29	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3024 ThreadCount=12
09:31:14	Trace	29	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3024 ThreadCount=12
09:31:14	Trace	29	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3024 ThreadCount=12
09:31:14	Trace	29	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3024 ThreadCount=12
09:31:14	Trace	29	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3024 ThreadCount=12
09:31:14	Trace	29	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3024 ThreadCount=12
09:31:14	Trace	27	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3164 ThreadCount=11
09:31:14	Trace	27	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3164 ThreadCount=11
09:31:14	Trace	27	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3164 ThreadCount=11
09:31:14	Trace	27	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3164 ThreadCount=11
09:31:14	Trace	10	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2584 ThreadCount=10
09:31:14	Trace	10	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2584 ThreadCount=10
09:31:14	Trace	10	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2584 ThreadCount=10
09:31:14	Trace	8	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2332 ThreadCount=9
09:31:14	Trace	8	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2332 ThreadCount=9
09:31:14	Trace	8	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2332 ThreadCount=9
09:31:14	Trace	8	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2332 ThreadCount=9
09:31:14	Trace	8	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2332 ThreadCount=10
09:31:14	Trace	8	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2332 ThreadCount=11
09:31:14	Trace	6	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1444 ThreadCount=8
09:31:14	Trace	8	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2332 ThreadCount=11
09:31:14	Trace	8	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2332 ThreadCount=12
09:31:14	Trace	29	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3024 ThreadCount=12
09:31:14	Trace	29	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3024 ThreadCount=11
09:31:14	Trace	27	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3164 ThreadCount=11
09:31:14	Trace	27	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3164 ThreadCount=10
09:31:14	Trace	27	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3164 ThreadCount=10
09:31:14	Trace	27	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3164 ThreadCount=10
09:31:14	Trace	10	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2584 ThreadCount=10
09:31:14	Trace	10	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2584 ThreadCount=9
09:31:14	Trace	10	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2584 ThreadCount=9
09:31:14	Trace	10	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2584 ThreadCount=9
09:31:14	Trace	10	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2584 ThreadCount=9
09:31:14	Trace	6	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1444 ThreadCount=8
09:31:14	Trace	6	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1444 ThreadCount=8
09:31:14	Trace	6	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1444 ThreadCount=8
09:31:14	Trace	6	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1444 ThreadCount=8
09:31:14	Trace	6	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1444 ThreadCount=8
09:31:14	Trace	6	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1444 ThreadCount=8
09:31:14	Trace	6	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1444 ThreadCount=8
09:31:14	Trace	3	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3856 ThreadCount=7
09:31:14	Trace	3	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3856 ThreadCount=7
09:31:14	Trace	3	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3856 ThreadCount=7
09:31:14	Trace	3	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3856 ThreadCount=7
09:31:14	Trace	3	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3856 ThreadCount=7
09:31:14	Trace	3	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3856 ThreadCount=7
09:31:14	Trace	3	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3856 ThreadCount=7
09:31:14	Trace	3	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3856 ThreadCount=7
09:31:14	Trace	33	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1376 ThreadCount=6
09:31:14	Trace	33	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1376 ThreadCount=6
09:31:14	Trace	33	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1376 ThreadCount=6
09:31:14	Trace	33	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1376 ThreadCount=6
09:31:14	Trace	33	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1376 ThreadCount=6
09:31:14	Trace	33	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1376 ThreadCount=6
09:31:14	Trace	33	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1376 ThreadCount=6
09:31:14	Trace	33	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1376 ThreadCount=6
09:31:14	Trace	31	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3552 ThreadCount=5
09:31:14	Trace	31	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3552 ThreadCount=5
09:31:14	Trace	31	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3552 ThreadCount=5
09:31:14	Trace	31	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3552 ThreadCount=5
09:31:14	Trace	31	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3552 ThreadCount=5
09:31:14	Trace	31	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3552 ThreadCount=5
09:31:14	Trace	31	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3552 ThreadCount=5
09:31:14	Trace	31	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3552 ThreadCount=5
09:31:14	Trace	22	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3208 ThreadCount=4
09:31:14	Trace	22	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3208 ThreadCount=4
09:31:14	Trace	22	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3208 ThreadCount=4
09:31:14	Trace	22	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3208 ThreadCount=4
09:31:14	Trace	22	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3208 ThreadCount=4
09:31:14	Trace	22	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3208 ThreadCount=4
09:31:14	Trace	22	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3208 ThreadCount=4
09:31:14	Trace	22	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3208 ThreadCount=4
09:31:14	Trace	16	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1468 ThreadCount=3
09:31:14	Trace	16	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1468 ThreadCount=3
09:31:14	Trace	16	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1468 ThreadCount=3
09:31:14	Trace	16	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1468 ThreadCount=3
09:31:14	Trace	16	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1468 ThreadCount=3
09:31:14	Trace	16	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1468 ThreadCount=3
09:31:14	Trace	16	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1468 ThreadCount=3
09:31:14	Trace	16	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1468 ThreadCount=3
09:31:14	Trace	15	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3724 ThreadCount=2
09:31:14	Trace	15	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3724 ThreadCount=2
09:31:14	Trace	15	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3724 ThreadCount=2
09:31:14	Trace	15	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3724 ThreadCount=2
09:31:14	Trace	15	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3724 ThreadCount=2
09:31:14	Trace	15	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3724 ThreadCount=2
09:31:14	Trace	15	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3724 ThreadCount=2
09:31:14	Trace	15	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=3724 ThreadCount=2
09:31:14	Trace	14	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2116 ThreadCount=1
09:31:14	Trace	14	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2116 ThreadCount=1
09:31:14	Trace	14	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2116 ThreadCount=1
09:31:14	Trace	14	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2116 ThreadCount=1
09:31:14	Trace	14	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2116 ThreadCount=1
09:31:14	Trace	14	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2116 ThreadCount=1
09:31:14	Trace	14	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2116 ThreadCount=1
09:31:14	Trace	14	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=2116 ThreadCount=1
09:31:14	Trace	9	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1432 ThreadCount=0
09:31:14	Trace	9	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1432 ThreadCount=0
09:31:14	Trace	9	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1432 ThreadCount=0
09:31:14	Trace	9	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1432 ThreadCount=0
09:31:14	Trace	9	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1432 ThreadCount=0
09:31:14	Trace	9	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1432 ThreadCount=0
09:31:14	Trace	9	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1432 ThreadCount=0
09:31:14	Trace	9	 TSQLRestServerDB.EndCurrentThread(THttpApiServer) ThreadID=1432 ThreadCount=0
09:31:14	Leave	1	       00.002.250
09:31:14	Exception	1	       EInvalidPointer ("Ungültige Zeigeroperation") at 0000000000408E72 

The Shutdown seems to start within 1s but at the end there is a EInvalidPointer Exception. May be that the service stops here and the os waits for something and sets a timeout to kill the process ?!

#516 mORMot 1 » net stop service takes 60s » 2014-11-26 16:05:47

itSDS
Replies: 5

Hi AB,

the Problem exists longer but had no time to write it.
I have programmed a mORMot service which has 8 Database Models and therefore 8 .db3 SQLite Files.
It also has 2 MVC - Folders.

For every Database it serves the wrapper and the SynDB.

If i start it as Console App it shut's down within 1 second.

But if i stop it with net stop servicename it takes 60s to shut down.
In the Log i can not find the cause for this 60 seconds.
Do you have a clue ?

#517 Re: mORMot 1 » Request TAutoFree for Crossplatform » 2014-11-25 13:46:41

Hi AB, i had to think about it.

I use Crossplatform for actually the follwing cases:

FMX - iOS: This is NextGEN - i don't need to free my Objects ?!
FMX - Android: also NextGEN ?
FMX - Windows: here i need it or can use the Windows - Client (I don't like to use the Windows - Client cause i have to program 2 Versions for Server Access) Here i would like to use TAutoFree
FMX - MacOS: NextGEN ?

I like to code every Version in the same way. Actually i Create try ... finally free
So if i put everything i TAutoFree i can modify the Platform specific code there smile

#519 Re: mORMot 1 » Interfaced Base Service Question » 2014-11-22 17:18:57

I testet a little bit and found that

ServiceContext.Factory.RestServer

could give me access to a TRestSQL which seems to contain my tables.

#520 mORMot 1 » Request TAutoFree for Crossplatform » 2014-11-22 16:38:53

itSDS
Replies: 3

Hi AB it would be great to have AutoFree also for the Crossplatform Client smile

#521 mORMot 1 » Interfaced Base Service Question » 2014-11-22 16:37:10

itSDS
Replies: 1

Hi AB,

now i think i have read the complete Manual and Found 2 basic Examples for Interfaced based Services

ICalculator and IRemoteSQL

Both are nice examples for the Interfacs itself but what I'm missing is an example how the Interface class (here TServiceRemoteSQL) can access the aServer where  it is registerd to.

    aServer := TSQLRestServerFullMemory.Create(aModel,'users.json',false,true);
    try
      // register our IRemoteSQL service on the server side
      aServer.ServiceRegister(TServiceRemoteSQL,[TypeInfo(IRemoteSQL)],sicShared)

I want to create a little Interface function which selects and creates and deletes some records in the Model / Database of aServer.

How can i get easy access to aServer in TServiceRemoteSQL.

#523 Re: mORMot 1 » Difference in the Resulting DataSet of ToClientDataSet and ToDataSet » 2014-11-21 15:57:36

Hi Arnaud,

i downloaded the last Version and testet both my testprogramm (i sent you) and SynDBExplorer with my SynDBRemote WebService

@testprogramm:
Now only 1 Column and 2 rows are shown. Column 1 is empty.

@SynDBExplorer:
now the 2 rows are shown but the one Field is as before filled with the same trash as before.

I'm using XE7

#524 Re: mORMot 1 » ToDataset produce corrupted data » 2014-11-20 12:25:03

Hi AB this is the same issue i have already reported !

#525 Re: mORMot 1 » Difference in the Resulting DataSet of ToClientDataSet and ToDataSet » 2014-11-20 12:07:21

sry ab don't know how to send a file to you. I made a zip if you need it tell me how pls.

#526 Re: mORMot 1 » Difference in the Resulting DataSet of ToClientDataSet and ToDataSet » 2014-11-20 11:16:15

i tried but did not fix the problem

I made a little test program from sample 17. I replaced test.db3 with my db3 - File and added my query.
I'll send the file via EMail.

#527 Re: mORMot 1 » Difference in the Resulting DataSet of ToClientDataSet and ToDataSet » 2014-11-19 14:41:46

Hi AB i think the Problem is somewhere in function TSQLDBRemoteConnectionPropertiesAbstract.Process on the Client.

The received compressed String is like that:

#$D#1#$B#2'ID'#2#0#8'UniqueID'#6#0#$C'Creatio'#0#0#1' nDate'#2#0#$C'LastEdit$`'#$B'Anzeigenamea'#$C'Be'#0#0#$10#8'schreibung'#6#0#9'KontaktÒB'#9'Logon„{'#$E'Has'#0#0#0'@hedPassword'#6#0#8'Verified'#2#0#6'RechtQ&'#0#0#0#0#0#1'&{6F454FFA-0C97-4780-BA69-6E982'#0'@'#0#0'02B2B3E}Ï'#$8D'ˆªï'#7'tT'#$D'Administrator1Au'#$18#0#0#0'toma/Q_ angelegt beim Erstellen de'#4#1#0#0'r "`nbank'#$11'„AEFDCD2-4A5F-469B-A1BB-'#0'@'#0#0'E4B3949DFFB2}'#5's)@0b7fc485eb399bdd'#0#0#0#0'e9e1c09cddceb2c396290dc23278831b'#0#0#0#0'e4e242981d119ed3'#1#$D#0#3'&{CC516404-5'#0#0'€03BC-4D4D-BC64-0B7E8A3DD!]}鸋Aý$'#5#$12'S'#0#4#0#0'tefan Dies!;mann'#0'&{8E746F41-F824-'#0#0#0#3'4236-8D73-83A5CB8356BC}'#6'A"'#1'x@2ad1b@'#0'€'#0'074845'#1#$14'2d8e73cbfe086991a'#$14'16d03f5b'#0#0#0#0'bd9da2d09849d6fa925aedf'#0#0#2#0#0#0

after uncompress the buffer is same as on server before compress:

1#$B#2'ID'#2#0#8'UniqueID'#6#0#$C'CreationDate'#2#0#$C'LastEditDate'#2#0#$B'Anzeigename'#6#0#$C'Beschreibung'#6#0#9'KontaktID'#6#0#9'Logonname'#6#0#$E'HashedPassword'#6#0#8'Verified'#2#0#6'Rechte'#2#0#0#1'&{6F454FFA-0C97-4780-BA69-6E98202B2B3E}Ï'#$8D'ˆªï'#7'Ï'#$8D'ˆªï'#7#$D'Administrator1Automatisch angelegt beim Erstellen der Datenbank&{6AEFDCD2-4A5F-469B-A1BB-E4B3949DFFB2}'#5'Admin@0b7fc485eb399bdde9e1c09cddceb2c396290dc23278831be4e242981d119ed3'#1#$D#0#3'&{CC516404-53BC-4D4D-BC64-0B7E8A3DDA69}鸋ªï'#7'鸋ªï'#7#$12'Stefan Diestelmann'#0'&{8E746F41-F824-4236-8D73-83A5CB8356BC}'#6'stefan@2ad1b0748453272d8e73cbfe0869910b716d03f5bbd9da2d09849d6fa925aedf'#0#0#2#0#0#0

OutputRawUtf8 after SetString SynDB Line 7093 is wrong !

1#$B#2'ID'#2#0#8'UniqueID'#6#0#$C'CreationDate'#2#0#$C'LastEditDate'#2#0#$B'Anzeigename'#6#0#$C'Beschreibung'#6#0#9'KontaktID'#6#0#9'Logonname'#6#0#$E'HashedPassword'#6#0#8'Verified'#2#0#6'Rechte'#2#0#0#1'&{6F454FFA-0C97-4780-BA69-6E98202B2B3E}ύ'#$88#$AA#$EF#7'ύ'#$88#$AA#$EF#7#$D'Administrator1Automatisch angelegt beim Erstellen der Datenbank&{6AEFDCD2-4A5F-469B-A1BB-E4B3949DFFB2}'#5'Admin@0b7fc485eb399bdde9e1c09cddceb2c396290dc23278831be4e242981d119ed3'#1#$D#0#3'&{CC516404-53BC-4D4D-BC64-0B7E8A3DDA69}鸋'#$AA#$EF#7'鸋'#$AA#$EF#7#$12'Stefan Diestelmann'#0'&{8E746F41-F824-4236-8D73-83A5CB8356BC}'#6'stefan@2ad1b0748453272d8e73cbfe0869910b716d03f5bbd9da2d09849d6fa925aedf'#0#0#2#0#0#0

may be a codesite Problem with SetString ?!

#528 Re: mORMot 1 » Difference in the Resulting DataSet of ToClientDataSet and ToDataSet » 2014-11-19 13:43:15

Hi AB i startet SynDBExplorer with the Debugger and analyzed the Result from Rows.FetchAllAsJSON.
The JSON contains the wrong content in the Field.
May be the Error is in the Server - Code of SynDBRemote.

I'll try to debug this also.

#529 Re: mORMot 1 » Difference in the Resulting DataSet of ToClientDataSet and ToDataSet » 2014-11-19 11:06:38

Hi AB, sorry for the litte delay,

AB wrote:

What do you call an "empty field"?
A column containing NULL?

In this case Empty means value = '' (Empty String, not null) dumped with sqlite3

AB wrote:

In SynDBExplorer, what is the corresponding JSON?

where can i get this ?

#530 Re: mORMot 1 » Difference in the Resulting DataSet of ToClientDataSet and ToDataSet » 2014-11-18 15:35:26

In SynDBExplorer the Output looks like ToDataset

I forgot the Connection is made with the new SynDBRemote.
If i connect directly to the Database the trash is not shown.

#531 Re: mORMot 1 » Difference in the Resulting DataSet of ToClientDataSet and ToDataSet » 2014-11-18 15:31:41

ToDataset output:

ID	UniqueID	CreationDate	LastEditDate	Anzeigename	Beschreibung	KontaktID	Logonname	HashedPassword	Verified	Rechte
1	{6F454FFA-0C97-4780-BA69-6E98202B2B3E}	135201358696	135201358696	Administrator	Automatisch angelegt beim Erstellen der Datenbank	{6AEFDCD2-4A5F-469B-A1BB-E4B3949DFFB2}	Admin	0b7fc485eb399bdde9e1c09cddceb2c396290dc23278831be4e242981d119ed3	1	7
2	{CC516404-53BC-4D4D-BC64-0B7E8A3DDA69}	135201386037	135201386037	My Name	&{8E746F41-F824-4236-8D73-83A5CB8356BC}stefan@2a	{8E746F41-F824-4236-8D73-83A5CB8356BC}	My	2ad1b0748453272d8e73cbfe0869910b716d03f5bbd9da2d09849d6fa925aedf	0	0

ToClientDataSet Output

ID	UniqueID	CreationDate	LastEditDate	Anzeigename	Beschreibung	KontaktID	Logonname	HashedPassword	Verified	Rechte
1	{6F454FFA-0C97-4780-BA69-6E98202B2B3E}	135201358696	135201358696	Administrator	Automatisch angelegt beim Erstellen der Datenbank	{6AEFDCD2-4A5F-469B-A1BB-E4B3949DFFB2}	Admin	0b7fc485eb399bdde9e1c09cddceb2c396290dc23278831be4e242981d119ed3	1	7
2	{CC516404-53BC-4D4D-BC64-0B7E8A3DDA69}	135201386037	135201386037	My Name		{8E746F41-F824-4236-8D73-83A5CB8356BC}	My	2ad1b0748453272d8e73cbfe0869910b716d03f5bbd9da2d09849d6fa925aedf	0	0

#532 mORMot 1 » Difference in the Resulting DataSet of ToClientDataSet and ToDataSet » 2014-11-18 15:21:29

itSDS
Replies: 15

Hi AB,

i got the following DataSet Result

In DB there are 2 Records

the first has no Empty Fields, the second has some empty fields.

with ToDataset some of the Empty Fields of the second record are filled with memory - fragments
with toClientDataset they are empty as expected.

if you need more help ask pls.

#533 Re: mORMot 1 » HTTP remote access for SynDB SQL execution » 2014-11-18 10:26:31

Hi Arnoud,

is it possible to enhance SynDBExplorer to Connect to such a Remote Host ?

ATM i have to look at some tables on server without shutting it down.
So Remote DB access could solve the Problem.

#535 Re: mORMot 1 » HTTP remote access for SynDB SQL execution » 2014-11-18 09:07:00

Great Work Arnaud with this you made any supported SQL Database a single unique Network Interface smile Esspecially SQLite

#536 Re: mORMot 1 » TCreateTime / TModTime and CrossPlatform Object Creation » 2014-11-17 22:39:33

Hi AB you are right but there is a bug in the Wrapper code generating the Client Pas - Files.

The fields i defined on the Server where TCreateTime and TModTime, but the code generated by the Wrapper make them TTimeLog.
As Result the HasTimeFields in ComputeFieldsBeforeWrite is false and the Values are nil.

I modified the generated code to TCreateTime / TModTime by hand and it works !

#537 mORMot 1 » TCreateTime / TModTime and CrossPlatform Object Creation » 2014-11-17 19:01:45

itSDS
Replies: 6

Hi AB,

i create TSQLRecord on my Mobile Device and don't Know how to set TTimeLog there. (No SynCommons.pas available sad )

#538 Re: mORMot 1 » InitializeTable and inheritance » 2014-11-10 13:52:54

Solved by mySelf !

Found in the Embarcadero Doku (http://docwiki.embarcadero.com/RADStudi … e/Methoden) that in class Functions the Self is defined as class of MyClass

so i pass Self to every CreateIndex and it works fine

#539 Re: mORMot 1 » InitializeTable and inheritance » 2014-11-10 13:39:59

I have 2 Ideas: the best would be it there exists something like "Self" Paramater for the ClassType (don't know if this exists in Delphi) an
pass it to
    Server.CreateSQLMultiIndex("Self - Classtype", ['fIndexfield1'], false);

the second is more Complicated and enhance InitializeTable with the Parameter (Table : TSQLRecordClass)

  class procedure InitializeTable(Server: TSQLRestServer; const FieldName: RawUTF8; Options: TSQLInitializeTableOptions; Table: TSQLRecordClass = nil);

In CreateMissingTables you call the default Paramater (Table = nil)

In custom classes we hav to get rid of this Param

in the derived InitializeTable we have to add

class procedure TDerivedClass.InitializeTable(Server: TSQLRestServer; const FieldName: RawUTF8; Options: TSQLInitializeTableOptions; Table: TSQLRecordClass);
begin
  inherited InitializeTable(Server, FieldName, Options: TSQLInitializeTableOptions, TDerivedClass);
  if (FieldName = '') or (FieldName = 'fIndexfield1') then
    Server.CreateSQLMultiIndex(TDerivedClass, ['fIndexfield1'], false);
end;

and in Baseclass:

class procedure TBaseClass.InitializeTable(Server: TSQLRestServer; const FieldName: RawUTF8; Options: TSQLInitializeTableOptions; Table: TSQLRecordClass);
begin
  if assigned(Table) then begin
    inherited (Server, FieldName, Options: TSQLInitializeTableOptions, Table);
    if (FieldName = '') or (FieldName = 'ReferenceID') then
      Server.CreateSQLMultiIndex(Table, ['ReferenceID'], false);
  end else begin
    inherited;
    if (FieldName = '') or (FieldName = 'ReferenceID') then
      Server.CreateSQLMultiIndex(TBaseClass, ['ReferenceID'], false);
  end;
end;

#540 mORMot 1 » InitializeTable and inheritance » 2014-11-10 13:27:20

itSDS
Replies: 3

Hi Arnoud i have the following Problem with InitializeTable:

suppose you have 2 TSQLRecord Classes :

class TBaseClass : TSQLRecord
..
  fReferenceID : RawUtf8;
..
  public
    class procedure InitializeTable(Server: TSQLRestServer; const FieldName: RawUTF8; Options: TSQLInitializeTableOptions); override;
...

and one derived Class:

class TDerivedClass : TBaseClass
..
  fIndexfield1 : RawUtf8;
..
  public
    class procedure InitializeTable(Server: TSQLRestServer; const FieldName: RawUTF8; Options: TSQLInitializeTableOptions); override;
...


class procedure TBaseClass.InitializeTable(Server: TSQLRestServer; const FieldName: RawUTF8; Options: TSQLInitializeTableOptions);
begin
  inherited;
  if (FieldName = '') or (FieldName = 'ReferenceID') then
    Server.CreateSQLMultiIndex(TBaseClass, ['ReferenceID'], false);
end;

class procedure TDerivedClass.InitializeTable(Server: TSQLRestServer; const FieldName: RawUTF8; Options: TSQLInitializeTableOptions);
begin
  inherited;
  if (FieldName = '') or (FieldName = 'fIndexfield1') then
    Server.CreateSQLMultiIndex(TDerivedClass, ['fIndexfield1'], false);
end;


If you call CreateMissingTables(0) an error occurs in TBaseClass.InitializeTable cause
    Server.CreateSQLMultiIndex(TBaseClass, ['ReferenceID'], false); is called with TBaseClass and not with TDerivedClass.

I think that it has to be changed to pass TDerivedclass to the TBaseClass InitializeTable !

#541 mORMot 1 » Set different View Folder for different MVCApplication » 2014-11-03 15:03:32

itSDS
Replies: 1

Hi AB, i found the place in the source where ViewTemplateFolder is initialized.

But i don't see the place where i can set this Parameter as i wan't

Can you please specify this in the Example.

#542 mORMot 1 » define Error in SynCommons.pas » 2014-11-03 13:57:59

itSDS
Replies: 1

Hi AB

cause of RawUTF8 Strings in used SynCommons.Pos in my code.
Under XE7 Win32 it is available but under Win64 not.
It depends on PurePascal which is wrong.

As a WorkAround i use SynCommons.PosEx(..,..,1) for Win64

#543 Re: mORMot 1 » Access Ctxt.InHeaders from MVC - Method » 2014-11-02 00:32:36

tyvm with

  Result := ServiceContext.Request.InHeader['Host'];

i get what i want smile

#544 mORMot 1 » Access Ctxt.InHeaders from MVC - Method » 2014-11-01 11:44:50

itSDS
Replies: 2

Hi AB great work with MVC !!

Now i have a question :

How can I access the Ctxt.InHeaders from one of the MVCApplication Method like Default or Login ?

I want to use the Subdomain/Domain as Switch

Customer1.localhost -> Site for Customer1
Customer2.localhost -> Site for Customer2
Customer3.xxx -> Site for Customer3

In Default / Login i need the Value of the SubDomain.

#546 mORMot 1 » Exception in mORMotWrappers.pas » 2014-10-21 16:24:21

itSDS
Replies: 2

I get the following error requesting something from the wrapper:

{
"ErrorCode":500,
"ErrorText":"Exception ESynException: TTextWriter.AddVariantJSON(VType=16387)"
}

Log-Entries:

20141021 18192424  +    TSQLRestServerDB(0030CDD0).0059B624 
20141021 18192424 call  	TSQLRestServerDB(0030CDD0) Wrapper
20141021 18192634 EXC   	ESynException ("TTextWriter.AddVariantJSON(VType=16387)") at 0052A477  stack trace API 0053C5D8 0040A900 
20141021 18192636 srvr  	GET JobCloud/wrapper/CrossPlatform/mORMotClient.pas.txt ERROR=500 (Exception ESynException: TTextWriter.AddVariantJSON(VType=16387))
20141021 18192636  -    02.189.861

#547 Re: mORMot 1 » Problem with UniDAC MySQL Windows 5.6 compared with Linux 5.5 » 2014-10-19 21:48:54

Hi Ab, as i wrote here: http://synopse.info/forum/viewtopic.php?id=2065
i made this little Modification where i set SCOPE to LOCAL. May Be this does an error on the Linux MySQL - i'll try this out ans set Schema to the used Schema.

In all cases it is wrong not to set the Schema - Parameter in GetFields of UniDAC. If it is not set all Tables of the complete Database will be searched for fields.

#548 Re: mORMot 1 » Problem with UniDAC MySQL Windows 5.6 compared with Linux 5.5 » 2014-10-18 08:44:14

ok - now i understand.
But back to my Error - Log

At

TSQLRestStorageExternal.Create(aClass: TSQLRecordClass; aServer: TSQLRestServer);
...
 fProperties.GetFields(fTableName,fFieldsExternal);
...

the GetFields seems to get no fields (REASON unknown atm)
the code goes into Create Table, were ExecuteDirect results in nil (cause of Create Table Exception)

      if ExecuteDirect(pointer(SQL),[],[],false)<>nil then begin
        fProperties.GetFields(fTableName,fFieldsExternal); // fields from DB after create
        if fFieldsExternal=nil then
          raise EORMException.CreateUTF8('%.Create: external table creation % failed:'+
            ' GetFields() returned nil - SQL="%"',[self,StoredClass,fTableName,SQL]);
      end;

no EORMException is raised. As Result Create Function tries no to create all Missing fields wich results in the next Exceptions.

I think we have to points now:

1. Why does Ubuntu MySQL 5.5 not return the Fieldlist of the Table ?
2. Why do you try to create Fields if Create Tables fails smile

I'll have a look at GetFields.

#549 Re: mORMot 1 » Problem with UniDAC MySQL Windows 5.6 compared with Linux 5.5 » 2014-10-17 10:05:42

Hi i digged a little in CreateMissingTables and SynDBUniDac

the call of

  fDB.GetTableNames(TableNamesAtCreation);

in CreateMissingTables does not result in

TSQLDBUniDACConnectionProperties.GetTableNames

is this a bug ?

#550 Re: mORMot 1 » Problem with UniDAC MySQL Windows 5.6 compared with Linux 5.5 » 2014-10-17 09:45:58

May be you are right,

first it want's to create a table which obviously exists. Then it want's to create a field which exists ...
But my Problem is connected to the other i postet.

What i saw in the source of mORMot, debugging CreateMissingTables is that the statement which selects the existing tables is written as SQLite Query.

'SELECT name FROM sqlite_master WHERE type=''table'' AND name NOT LIKE ''sqlite_%'';'

Should SQLite Engine transfer this statement to a UniDAC GetTablenames Statement ? Or a MySQL Query to get Tablenames ?

Board footer

Powered by FluxBB