PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WB21] Long running MS SQL Query in background ?
[WB21] Long running MS SQL Query in background ?
Iniciado por guest, 07,jul. 2016 14:57 - 2 respuestas
Publicado el 07,julio 2016 - 14:57
Hi,

What would be the best strategy to run an long calculation that is done in a MS SQL stored Procedure triggered by a user action from a webpage ?

The user presses the"Calculate" button on the webpage. This will call a procedure on the WebDev Server Side that is calling the MS SQL Stored Procedure that does the calculation. This calculation takes about 1 to 2 minutes depending on the parameters.

I show a wait dialog on the screen, but my Browser (Chrome) will display an warning box that the server is not responding. You can select cancel or wait. But if it takes to long it will just abort the whole thing ! Even the warning box is not wanted.

Can I start a thread on server side to run this procedure in the background ?
En when it is finished, how can I notify the user ? I would like to show a "Calculating NOW" message in the browser that would disappear when the calculation is done, even if this calculation or process would take a few minutes and would exceed the browser response timeout !

How to best approach this kind of problem ?

Thanks
Danny
Publicado el 07,julio 2016 - 16:20
Hi Danny,

you could use a call made with ajaxexecuteasynchronous from browser code...

This call doesn't wait for a return, so you would't have your warning message, and it will call a local/blorwser procedure when finished

Best regards
Publicado el 08,julio 2016 - 01:25
Thanks Fabrice,

I'll try that direction and post the results here !

Danny