You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jürgen Liesche <jl...@web.de> on 2005/05/27 13:01:09 UTC

2 parallel requests from one user

Hi all,

we have a struts action which runs in some cases very long (> 1min). In this case, a firewall between client and server cuts the connection due to inactivity. To avoid this timeout, we execute the core action in a thread, while the wrapper action polls the result of the action thread. If the result (the forward object) comes in time everything is ok and we forward to the next page. If the action takes too much time we forward to a refresh page, just before the firewall timeout will be activated. This refresh page calls the wrapper action again, and polls for a result of the core action thread until it is available. The problem is, that the core action uses the request and response objects. But these objects will be invalid, if the refresh page calls the wrapper action again and therefore the core action pukes.
We use struts 1.1 and tomcat 4.1.x
Does anybody have an idea, how to solve these problem?
Thanks in advance for help.
__________________________________________________________
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: 2 parallel requests from one user

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
On 27/05/05 16:32&nbsp;Michael Jouravlev wrote:

> * Because you redirect to output action instead of forwarding, it can
> be reloaded anytime as many times as needed, either by javascript or
> manually by user.

or

<meta http-equiv="refresh" content="5; URL=http://where.i.was/">

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: 2 parallel requests from one user

Posted by Michael Jouravlev <jm...@gmail.com>.
* Call the first action (input)
* Deny service if long process is already running for this client
* Harvest input data and kick off the long process
* Redirect (not forward) to output action, which displays result page
#2 (see below) right away
* Result page #2 must have an auto-refresh javascript
* Output action MUST NOT blow out if result is not ready
* Ouput action accesses the server and checks if output is ready. If
yes, it displays it in result page #1, if no, it displays the "Please,
wait" message in result page #2
* Because you redirect to output action instead of forwarding, it can
be reloaded anytime as many times as needed, either by javascript or
manually by user.

Michael.

On 5/27/05, Jürgen Liesche <jl...@web.de> wrote:
> Hi all,
> 
> we have a struts action which runs in some cases very long (> 1min). In this case, a firewall between client and server cuts the connection due to inactivity. To avoid this timeout, we execute the core action in a thread, while the wrapper action polls the result of the action thread. If the result (the forward object) comes in time everything is ok and we forward to the next page. If the action takes too much time we forward to a refresh page, just before the firewall timeout will be activated. This refresh page calls the wrapper action again, and polls for a result of the core action thread until it is available. The problem is, that the core action uses the request and response objects. But these objects will be invalid, if the refresh page calls the wrapper action again and therefore the core action pukes.
> We use struts 1.1 and tomcat 4.1.x
> Does anybody have an idea, how to solve these problem?
> Thanks in advance for help.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: 2 parallel requests from one user

Posted by Hubert Rabago <hr...@gmail.com>.
You should make the effort to remove the dependency of the core action
on the request and response objects.  Just retrieve the data you need
from the request and response and cache them so that they'll be
available for the duration of your long process.  I'm hoping that when
you call it "core action", you don't mean that the object doing the
processing is a Struts Action subclass.  If it is, I suggest that you
use a POJO instead, with fields to hold the request data you need.

Hubert

On 5/27/05, Jürgen Liesche <jl...@web.de> wrote:
> Hi all,
> 
> we have a struts action which runs in some cases very long (> 1min). In this case, a firewall between client and server cuts the connection due to inactivity. To avoid this timeout, we execute the core action in a thread, while the wrapper action polls the result of the action thread. If the result (the forward object) comes in time everything is ok and we forward to the next page. If the action takes too much time we forward to a refresh page, just before the firewall timeout will be activated. This refresh page calls the wrapper action again, and polls for a result of the core action thread until it is available. The problem is, that the core action uses the request and response objects. But these objects will be invalid, if the refresh page calls the wrapper action again and therefore the core action pukes.
> We use struts 1.1 and tomcat 4.1.x
> Does anybody have an idea, how to solve these problem?
> Thanks in advance for help.
> __________________________________________________________
> Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
> weltweit telefonieren! http://freephone.web.de/?mc=021201
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org