Hello,
I need some general advices on a project architecture (Delphi XE5).
My purpose is to develop a Windows service that returns various type of data coming from an Oracle database and that respond to a client application.
Server side, actually, I have the following components put inside a TService:
1) a TrtcHttpServer + TrtcServerModule. TrtcHttpServer have MultiThreaded := True and Blocking := False
2) a number of TrtcFunctions components that performs the requests to database and returns data to the client ?
3) one Session (database) component, create at design time, that will be connected to DB on OnServiceStart event
4) a number of TQuery and TStoredProc components, created ad design time, that phisically performs queries on database.
For database connectivity, I use SQLDirect (but this shouldn't be a critical point).
Client side, I have a VCL applications (32 bit) that performs requests on http server. Clients can be both on the same LAN, but also and expecially on different locations connected through ADSL and VPN.
Client program uses a TrtcHttpClient + TrtcClientModule component, plus a TrtcResult component for every kind of request. Client requests are non-blocking (using Call method) for query requests, and blocking using (Execute method) for stored-procedure requests.
Whit this architecture, the service and client works. Sometimes, the server don't answer to a request, so the client seems to be hang.
So, my questions are two:
Server side: what I developer until now, is the best approach ? Or there are some better solutions I can implement (e.g. using a DB connection pool, create database and queries components at runtime inside every TrtcFunctionsExecute event) ?
Client side: what is the best event to understand if a request failed ? I actually use TrtcResult.OnRequestAborted, that works fine for networking problems or if the service is stopped, but not when the service will not answer. Basically, I would like to understand how to implement a timeout management. Help is not very clear on this point, IMO (or I don't search well
).
Thanks in advice. If something is not clear, feel free to ask everything (english is not my 1st language).
Giuseppe Garzotto