#1 2015-06-24 20:12:06

Alvar Mayor
Member
Registered: 2015-06-05
Posts: 5

THttpApiServer Process

In a server (a VCL FOrms application), i use a THttpApiServer and in the Process function i load a DLL, call a function that must load data from a SQL Server 2008 database.

In a test program if i load my dll and call the function, all works, i see the data.
In the server, if i place a button, and in the onclick i load the dll, and clal the function, i see the data.
In the process function i always have an error, like the process function could not "see" SQL Server.

Maybe the Process funcion is executed in a separate thread wit low rights?

Offline

#2 2015-06-24 21:11:09

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

Re: THttpApiServer Process

THttpApiServer has its own thread pool.
So each thread should initiate its own connection to SQL Server.

Honestly, the easiest is not to start from THttpApiServer, but from a method-based or interface-based service at TSQLRestServer level.
It already supports proper threading, compatible with SynDB.
See http://synopse.info/files/html/Synopse% … #TITLE_265
Do not reinvent the wheel!

Offline

Board footer

Powered by FluxBB