NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: rainerwallenius on July 27, 2015, 02:57:01 AM

Title: Re-triggering server side code on form
Post by: rainerwallenius on July 27, 2015, 02:57:01 AM
Hi all

I have some memory forms that execute some sort of longish routines, mainly imports or exports that can take a while (several minutes). My question is: What mechanism might trigger a new request for that routine - browser sends a new post or keep-alive or something?
Is this something that only I have managed to mess up or have others noticed this?
I have solved this by adding a session variable that is set when the process starts and if it is set, the process itself does not start again.
It would be interesting to know the cause of this behaviour and how it could be better handled.

:: rainer
Title: Re: Re-triggering server side code on form
Post by: urayoan on July 27, 2015, 05:57:45 AM
Rainer:
  Hope this helps. Check the last point regarding the method p_web.NoOp()

http://www.nettalkcentral.com/index.php?option=com_smf&Itemid=36&topic=1408.0

Title: Re: Re-triggering server side code on form
Post by: kevin plummer on July 27, 2015, 04:42:29 PM
Hi Rainer,

the noop will only work if the browser is timing out but sounds like users keep pressing the buttons to do something while the server is already busy doing it so the process executes more than once.

I've also used your method setting a session value to stop it running again until the original process completes. I would also look at the progress bar as this will give your users a visual aide something is actually happening.

I also spool long running process's on their own thread and have a browse that lets the user know when the process is complete where they can just click a link etc This free's them up to keep working while the report or excel file is being generated in the background.

Hope that helps,

Kervin
Title: Re: Re-triggering server side code on form
Post by: rainerwallenius on July 28, 2015, 02:08:13 AM
Thanks guys,

I Have never used noop so that's seems like a good tip.
I tried once (or twice) the progress bar without luck. I will try again.

:: rainer
Title: Re: Re-triggering server side code on form
Post by: Bruce on July 28, 2015, 03:11:58 AM
Hi Rainer,

yes, the progress bar is your best approach. This gives feedback to the user while at the same time allows for "any length" of process. The NoOp approach is ok, but not as good, and gives no feedback to the user.

If you're struggling with progress bars we had a good look at the mechanics of it in User Group webinar #69.
http://www.capesoft.com/accessories/NetTalkUserGroup.htm

cheers
Bruce