You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Tyrrell <JT...@appriss.com> on 2002/02/13 20:24:48 UTC

Showing a result after a long running query

Hello all,

I have looked at the struts docs and all over the net and I have posted to
forums at java.sun.com.

I want to show a user a page that says I am working on your problem and then
when the processing is done I will send to them/display for them the output
of the long running database query/process whatever.  

Note I do not want the working in progress page to be shown again if I hit
the back button of the browser. I should just get to the form that I
inputted my parameters into to get the process rolling.

Does struts support this?
Does anyone know how to do this with some other technology?

This seems like a common problem and there should be an easy solution or at
least you would think so.

Thank You
Jim Tyrrell


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Showing a result after a long running query

Posted by Keith <ke...@yahoo.com>.
Chris's idea seems good.
But I think users might find such a screen rather irritating.

Some thoughts:-
1 - I've heard of something called 'push' technology. Servers push data out to
the client when it suits them. Search web for that.
2 - Alternative.
   Store on your DB that a request for this user has started but not finished.
   Start request & display the request status enquiry...
   Request Status enquiry.
      Using good old struts (so we aren't off topic here) write a page that
      lists the users uncompleted requests. At the top is a big message
      Press F5 To Update The Status list

This has the advantage that your request the status of the request are using
the same data store so are in the same transaction. So when things foul up your
list of requests always tells the truth.
K/
--- Chris Birch <ch...@artlas.net> wrote:
> Jim,
> 
> These comments are really guesses about how to do this rather than
> knowledge... None of it relies on Struts in particular.
> 
> You have three pages: Form, Working and Results.
> 
> On the form page, you submit the data to the Working page which will store
> the query request somewhere (possibly in the session scope but preferably in
> the DB) and return a page with an animated 'working' gif.  This page then
> uses a <meta http-equiv="refresh"> to call the Results page.  The animated
> gif of the Working page just keeps on animating until your long query /
> process returns some output to the browser.  In IE 5.5 + Netscape 6 on NT,
> when pressing the back button it ignores the Working page so you should be
> fine.
> 
> HTH,
> Chris.
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Jim Tyrrell [mailto:JTyrrell@appriss.com]
> Sent: 13 February 2002 19:25
> To: 'struts-user@jakarta.apache.org'
> Subject: Showing a result after a long running query
> 
> 
> Hello all,
> 
> I have looked at the struts docs and all over the net and I have posted to
> forums at java.sun.com.
> 
> I want to show a user a page that says I am working on your problem and then
> when the processing is done I will send to them/display for them the output
> of the long running database query/process whatever.
> 
> Note I do not want the working in progress page to be shown again if I hit
> the back button of the browser. I should just get to the form that I
> inputted my parameters into to get the process rolling.
> 
> Does struts support this?
> Does anyone know how to do this with some other technology?
> 
> This seems like a common problem and there should be an easy solution or at
> least you would think so.
> 
> Thank You
> Jim Tyrrell
> 
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Showing a result after a long running query

Posted by Chris Birch <ch...@artlas.net>.
Jim,

These comments are really guesses about how to do this rather than
knowledge... None of it relies on Struts in particular.

You have three pages: Form, Working and Results.

On the form page, you submit the data to the Working page which will store
the query request somewhere (possibly in the session scope but preferably in
the DB) and return a page with an animated 'working' gif.  This page then
uses a <meta http-equiv="refresh"> to call the Results page.  The animated
gif of the Working page just keeps on animating until your long query /
process returns some output to the browser.  In IE 5.5 + Netscape 6 on NT,
when pressing the back button it ignores the Working page so you should be
fine.

HTH,
Chris.





-----Original Message-----
From: Jim Tyrrell [mailto:JTyrrell@appriss.com]
Sent: 13 February 2002 19:25
To: 'struts-user@jakarta.apache.org'
Subject: Showing a result after a long running query


Hello all,

I have looked at the struts docs and all over the net and I have posted to
forums at java.sun.com.

I want to show a user a page that says I am working on your problem and then
when the processing is done I will send to them/display for them the output
of the long running database query/process whatever.

Note I do not want the working in progress page to be shown again if I hit
the back button of the browser. I should just get to the form that I
inputted my parameters into to get the process rolling.

Does struts support this?
Does anyone know how to do this with some other technology?

This seems like a common problem and there should be an easy solution or at
least you would think so.

Thank You
Jim Tyrrell


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Showing a result after a long running query

Posted by James Mitchell <jm...@yahoo.com>.
Ahhh, the long running query problem.  Yes its a classic.

I agree with Michael though.  The answer to your dilemma has nothing to do
with struts, java, or anything else on the "server" side of the application
at all.  This is a limit of web technology in general.

I've written a few applications that handle similar "opportunities" (my
friendly name for problems).

In one case, the user created downloadable files that were extracted from a
DRP system (KBM on AS/400 DB2).
The challenge was how to create the file and let the user download it all
from the web.

What I ended up with was a "Crystal Reports"-like web application, where the
user used a wizard to create the initial parameters that were passed to an
asynchronous process that ran in the background and updated the db when it
was finished.  The user just had to sit back and wait for the extract to
finish.  They could refresh the page of processing jobs all they wanted, but
it wouldn't let them download it until it was finished.

You might try creating some summary tables for common "long running
queries", if you are reporting summary analysis.  This technique has helped
me eliminate the need for my "Crystal Reports"-like app on my current
project.



James Mitchell
Software Engineer
Open-Tools.org
Home Phone (770) 822-3359
Cell Phone: (678) 910-8017


-----Original Message-----
From: Michael [mailto:moores@speakeasy.net]
Sent: Saturday, February 16, 2002 2:09 PM
To: Struts Users Mailing List
Subject: RE: Showing a result after a long running query


out of curiosity, how are you doing the server side transaction
asynchronously?  you can't block on the request thread, so obviously
you hurl a "prosessing page" and close the socket..
but in the back end, how is the request processed?

i just finished a credit card processor application where
i used meta-refresh in the web page with a timestamp to handle a timeout.
but in the initial request i use JMS (java message service) to queue
a request to a destinination and that request is handled my a JMS message
listener.
JMS processes the request and stores/commits the response in the target
payment record.



-----Original Message-----
From: Jim Tyrrell [mailto:JTyrrell@appriss.com]
Sent: Wednesday, February 13, 2002 11:25 AM
To: 'struts-user@jakarta.apache.org'
Subject: Showing a result after a long running query


Hello all,

I have looked at the struts docs and all over the net and I have posted to
forums at java.sun.com.

I want to show a user a page that says I am working on your problem and then
when the processing is done I will send to them/display for them the output
of the long running database query/process whatever.

Note I do not want the working in progress page to be shown again if I hit
the back button of the browser. I should just get to the form that I
inputted my parameters into to get the process rolling.

Does struts support this?
Does anyone know how to do this with some other technology?

This seems like a common problem and there should be an easy solution or at
least you would think so.

Thank You
Jim Tyrrell


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Showing a result after a long running query

Posted by Michael <mo...@speakeasy.net>.
out of curiosity, how are you doing the server side transaction
asynchronously?  you can't block on the request thread, so obviously
you hurl a "prosessing page" and close the socket..
but in the back end, how is the request processed?

i just finished a credit card processor application where
i used meta-refresh in the web page with a timestamp to handle a timeout.
but in the initial request i use JMS (java message service) to queue
a request to a destinination and that request is handled my a JMS message
listener.
JMS processes the request and stores/commits the response in the target
payment record.



-----Original Message-----
From: Jim Tyrrell [mailto:JTyrrell@appriss.com]
Sent: Wednesday, February 13, 2002 11:25 AM
To: 'struts-user@jakarta.apache.org'
Subject: Showing a result after a long running query


Hello all,

I have looked at the struts docs and all over the net and I have posted to
forums at java.sun.com.

I want to show a user a page that says I am working on your problem and then
when the processing is done I will send to them/display for them the output
of the long running database query/process whatever.

Note I do not want the working in progress page to be shown again if I hit
the back button of the browser. I should just get to the form that I
inputted my parameters into to get the process rolling.

Does struts support this?
Does anyone know how to do this with some other technology?

This seems like a common problem and there should be an easy solution or at
least you would think so.

Thank You
Jim Tyrrell


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>