#1 2017-09-13 21:05:46

JD
Member
Registered: 2015-08-20
Posts: 101

Cannot start TSQLRestServerFullMemory

Hi there,

I'm having some trouble creating an instance of TSQLRestServerFullMemory to use with some interface based services in front of a Firebird database. My code is as follows

procedure TfrmSakilaServer.StartServer;
begin
  //
  Model := TSQLModel.Create([], ROOT_NAME);
  DB := TSQLRestServerFullMemory.Create(Model, false);
  // register our ISakilaRESTInterface service on the server side
  DB.ServiceRegister(TSakilaRESTMethods, [TypeInfo(ISakilaRESTInterface)], SERVICE_INSTANCE_IMPLEMENTATION).
    SetOptions([], [optExecInMainThread, optFreeInMainThread]);
  HttpServer := TSQLHttpServer.Create(DEFAULT_HTTP_PORT, [DB], '+', HTTP_DEFAULT_MODE, 32, secNone);
  HttpServer.AccessControlAllowOrigin := '*';           // allow cross-site AJAX queries
end;

The problem is with the line

DB := TSQLRestServerFullMemory.Create(Model, false);

What is wrong with my code?

Thanks for your assistance,

JD

Last edited by JD (2017-09-13 21:06:37)

Offline

#2 2017-09-14 06:39:57

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,225
Website

Re: Cannot start TSQLRestServerFullMemory

You need a true sqlite engine in front of the external database.
Use TSQLRestServerDB, as documented.

Offline

#3 2017-09-20 14:17:40

JD
Member
Registered: 2015-08-20
Posts: 101

Re: Cannot start TSQLRestServerFullMemory

ab wrote:

You need a true sqlite engine in front of the external database.
Use TSQLRestServerDB, as documented.

Hi there ab,

I have established that the problem is due to the fact that the most recent version of mORMot (Version 1.18.3680 FTS3) has problems with Lazarus. I tried to compile TestSQL3.lpi using

a) Lazarus 1.8RC4/FPC 3.0.4
b) Lazarus stable (1.6.4/FPC 3.0.2)
c) NewPascal

While all three compiled without problems, the TestSQL3 executable produced by (a) and (b) does not run/work even in administrator mode. As for (c), the TestSQL3 executable worked and passed all the tests as expected BUT after it finishes and you press ENTER to close the console windows, an unending repeating sequence of error messages appears

Internal error: Unknown dwarf form: $17
Internal error: Unknown dwarf form: $19

TASK, line 5713 of ..\SynCrtSock.pas
EXECUTE, line 5671 of ..\SynCrtSock.pas

It is curious because all TestSQL3 executables produced by these Lazarus versions used to work before.

For the moment, I'll stick to using Delphi when I use mORMot (which means no Linux) but do you think it is worth investigating.

Thanks,

JD

Last edited by JD (2017-09-20 14:23:10)

Offline

#4 2017-09-20 15:38:24

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,225
Website

Re: Cannot start TSQLRestServerFullMemory

On which platform?

Offline

#5 2017-09-20 17:54:15

JD
Member
Registered: 2015-08-20
Posts: 101

Re: Cannot start TSQLRestServerFullMemory

ab wrote:

On which platform?

Windows 7 64 bit but using Lazarus/NewPascal 32 bit versions. Delphi 2010

Last edited by JD (2017-09-20 17:55:06)

Offline

#6 2017-12-04 14:59:10

GeorgeGil
Member
Registered: 2017-12-04
Posts: 1

Re: Cannot start TSQLRestServerFullMemory

Any Progress on this ?

Cannot start TSQLRestServerFullMemory
Lazarus 1.8, windows

Offline

#7 2017-12-04 17:26:06

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,225
Website

Re: Cannot start TSQLRestServerFullMemory

I'm not able to reproduce the problem.

Offline

Board footer

Powered by FluxBB