Java SOE and multithreading

Discussion created by m.rieke on Apr 10, 2014
Latest reply on Apr 12, 2014 by rlwatson

I am developing an SOE using Java for AGS 10.2. For some interactions with the operations of the SOE a set of database queries are required that may take a few minutes. In order to speed things up, I have developed a little caching component that dumps the results of these queries into a file on the HDD.

What I am struggling now with: this caching component should run in the background as a maintenance task. Now, whenever this task runs (and it runs for several minutes) the interaction with the operations of the SOE is not possible any longer. It seems like it is locked by the background task. It even does not reach the "handleRESTRequest(...)" method.

I could not find any documentation regarding locking and threading in SOE development. Is this intended behaviour? And if so, is there any workaround you could think of? I just don't want the service to block whenever my cache is updating.