Question. ROService times out (1053 error of Windows Services). How to solve this? (Help needed)

I’m quite a newby on Windows Services. But I need to switch from a server (desktop executable) to a windows service. Which can be done quite easily using RO. Thanks for that.

My server (and thus service) loads a lot of static data in memory. Clients can query among that data via several requests. The main issue is that the loading of the static data takes about 90 seconds. And Windows Service throws a time-out after 30 seconds and thus my service will never be started.

Currently the static data is loaded directly with the first datamodule that is created via ROService.CreateForm(TDmMyStaticDataModule, DmMyStaticDataModule).

Is there any parameter / method from within my RO service to allow the startup time of 90 seconds? (A regedit change that I found on the web is not really a solution that I prefer).

Or probably, I should take a completely other approach? But well… My service needs the data… I’m open to any suggestion and solution.

Thanks in advance.

Hi there,

You have a couple of options. First one and the simpler one is to increase the service timeout value. This can be controlled from the Windows Registry and as far as I know can not be set from the RO Service class.

Google is your friend, look for How to increase Windows service timeout.

Second, and the one I will suggest is to load your data on a separate thread so the service can report itself as started.

We do it all the time and the Delphi Parallel programming library will help you to achieve that easily.

Thanks! I think that the separate thread is the way to go [*]

The regedit option was the one I found via our mutual friend (Google). But I disliked that option since it is an extra pre-condition for the servers where this service will be located.

[*] I just implemented the loaddata routine via a TTask.Run and everything works fine.