#1 Re: mORMot 1 » Table with more than 64 fields not filled over HTTPClient » 2017-06-20 19:00:27

I tested again.
Server not     registered. The debugger show TSQLHttpServer: http.sys URI registration error #5 for http://+888/root (administratior rights neede, at least once to register the URI)
but it runs with the problem > 1 KB
Server registered.
The erro message do not appear.
No problems. Serverside Ctxt.InConcent = decompressed and readable data

#2 Re: mORMot 1 » Table with more than 64 fields not filled over HTTPClient » 2017-06-20 18:38:27

No. it handle > 1KB but it compressed the data on clientside in SynCrtSock, and the Server recieve this data without
encoding or better decompressed.

In  mORMotHttpServer Line 954 call.inBody := Ctxt.InConcent
there are the compressed data or decode data. Like êïÆ#5#7 and so on, not usefull.
The client add the compress mode into the POST message.

#3 Re: mORMot 1 » Table with more than 64 fields not filled over HTTPClient » 2017-06-20 17:53:09

The Problem:
Datasize > 1024 will be compress on clientside (without any messages)
On server side nothing happend. The very bad sideeffect = server fill null data in all fields and no error.
That is not a good idea.
See Documentation 11.4.2
All this happen if you do not register the server like Sample Project04ServerRegister
I never have calculate with such problems. 2 days over.
The solution
Register the server like Sample Project04ServerRegister

#4 Re: mORMot 1 » Table with more than 64 fields not filled over HTTPClient » 2017-06-20 12:23:06

The problem is between client and server communication, because on serverside i can insert
data into the table without problems.
Tabledefinition with a lot of fields with long fieldnames may be the real couse and not fieldcount > 64
Perhaps only on my system. But i can't find my mistake.

Thank's for your help.

#6 Re: mORMot 1 » Table with more than 64 fields not filled over HTTPClient » 2017-06-20 09:30:58

The difference is short and long fieldname.
There must be a problem memoryproblem

TSQLA70 = class(TSQLRecord)
 private
  ff1 : RawUTF8;
  .
  .
  .
  f70 : RawUTF8;
  published
   property f1 : RawUTF8 index 100 read ff1 write ff1;
   .
   .
   .
   property f70 : RawUTF8 index 100 read ff70 write ff70;
 end;

Table with definition works

TSQLA70 = class(TSQLRecord)
 private
  ff1longfieldname : RawUTF8;
  .
  .
  .
  f70longfieldname : RawUTF8;
  published
   property f1longfieldname : RawUTF8 index 100 read ff1longfieldname write ff1longfieldname;
   .
   .
   .
   property f70longfieldname : RawUTF8 index 100 read ff70longfieldname write ff70longfieldname;
 end;

Table with definition doesn't work

#7 Re: mORMot 1 » Table with more than 64 fields not filled over HTTPClient » 2017-06-20 09:23:29

In mORMot.pas
function TSQLRecord.getJasonValues ...
i see the J.DataString with all fieldnames and values
result=rowid without error

#8 Re: mORMot 1 » Table with more than 64 fields not filled over HTTPClient » 2017-06-20 09:11:04

I have made another test.
Table with 70 fields. Fieldnames f1 ... f70 = everyting OK.
Log: "insert into dbo.A70 (ID,.... all field and values
I change the name to f1longfieldname .. f70longfieldname => that the problem
Log:
DB "insert into dbo.A70 (ID) values(?)
SQL insert into dbo.A70 (ID) values (2)

No more fields and values

#9 mORMot 1 » Table with more than 64 fields not filled over HTTPClient » 2017-06-19 17:04:52

island
Replies: 12

Server

  // set logging abilities
  SQLite3Log.Family.Level := LOG_VERBOSE;
  SQLite3Log.Family.EchoToConsole := LOG_VERBOSE;
  SQLite3Log.Family.PerThreadLog := ptIdentifiedInOnFile;
  FDPhysMSSQLDriverLink := TFDPhysMSSQLDriverLink.Create(nil);

  // define the log level
  with TSQLLog.Family do begin
    Level := LOG_VERBOSE;
    EchoToConsole := LOG_VERBOSE; // log all events to the console
    PerThreadLog := ptIdentifiedInOnFile;
  end;
  // manual switch to console mode
  AllocConsole;
  TextColor(ccLightGray); // needed to notify previous AllocConsole

  aProps := TOleDBMSSql2012ConnectionProperties.Create('server-ip\SQLEXPRESS2008','TEST','TESTADMIN','123');
  try
    // get the shared data model
    Model := CreateModel;
    VirtualTableExternalRegisterAll(Model,aProps);
    try
      // create the main mORMot server
       aRestServer := TSQLRestServerDB.Create(Model,true); // authentication=true
      try
       aRestServer.AuthenticationRegister(TSQLRestServerAuthenticationNone);
       // create tables or fields if missing
       aRestServer.CreateMissingTables;
       InsertTab70; //   aRestServer.Add(test70,true); <== OK
       // serve aRestServer data over HTTP
       aHttpServer := TSQLHttpServer.Create(SERVER_PORT,[aRestServer],'+',useHttpApiRegisteringURI);
       try
         aHttpServer.AccessControlAllowOrigin := '*'; // allow cross-site AJAX queries
         writeln('Background server is running.'#10);
         write('Press [Enter] to close the server.');
         readln;
       finally
         aHttpServer.Free;
       end;
     finally
       aRestServer.Free;
     end;
    finally
     Model.Free;
    end;
  finally
    aProps.Free;
    FDPhysMSSQLDriverLink.Free;
  end;

Client:

  Client := TSQLHttpClientWinHTTP.Create(dbname,port,Model);


 a70 : TSQLTest70;


begin
    a70 := TSQLAnw.Create(Client,'Name=?',['test']);
    if a70.ID = 0 then
    begin
     a70.name := 'test';
     result := Client.Add(a70,true); 
     // Result = id-Number, it seems everythink OK, but it isn't.
     // every fields are null
    .
    .
    .

The same code with  a table with 64 fields works.
In Delphi Berlin 10.1 i set the definition MAX_SQL_FIELDS_128

I can't find my mistake.

Thank's for help

#10 mORMot 1 » Oracle Date Field SynVirtualDataSet invalid timestamp » 2017-02-20 19:10:44

island
Replies: 2

Hi,

Base is Sample 17
mORMotVCLUnit
I get an invalid timestamp error if e try to show a datefield

procedure TForm1.FormCreate(Sender: TObject);
begin
  fProps := TSQLDBOracleConnectionProperties.Create('dbname','','user','pwd');
end;
...
var
  t : TDateTime;
...

      ds1.DataSet := TSynDBSQLDataSet.Create(self);
      TSynDBSQLDataSet(ds1.DataSet).Connection := fProps;
      TSynDBSQLDataSet(ds1.DataSet).CommandText := 'select DATUM from mtest';
      ds1.DataSet.Open;
      ds1.DataSet.First;
      while not ds1.DataSet.Eof do
      begin
	  //if i use in SynVirtualDataSet an old version
          //function TSynVirtualDataSet.GetFieldData(Field: TField; Buffer: Pointer): Boolean;
          //...
          //ftDateTime:
          //  DateTimeToNative(Field.DataType,PDateTime(Data)^,Dest^); 
	  //then no error hier
  	   t := ds1.DataSet.FieldByName('DATUM').AsDateTime; 
	   
	   // but if i use in SynVirtualDataSet the last version
           //ftDateTime:
	   //    TDatetimeRec(Dest^) := PDateTime(Data)^; 
	   // i get an error hier <<< invalid timestamp 
	    t := ds1.DataSet.FieldByName('DATUM').AsDateTime; 
       st := DateToStr(t);
       if st ='' then;
       ds1.DataSet.Next;
      end;

Hope you can understand the problem

Thank you.

Board footer

Powered by FluxBB