Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Solution for Browser Time Out

 
apurb sinha
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frnds,
Our application is supposed to handle heavy data base level calculations and retrieving, which takes too much time. do we have any way by which we can increase the Browser Time Out limit. Or else can we write some filter to keep the connection alive with the browser.
Thanks In Advance.

[edit: not so urgent]
[ September 20, 2006: Message edited by: Bear Bibeault ]
[BPSouther: fixed non-words in subject line]
[ September 20, 2006: Message edited by: Ben Souther ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
apurb sinha,
Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:
UseRealWords

Abbreviations such as "u" or "ur" in
place of "you" and "you are" or "you're" confound language translation software making
it hard for our non-English speaking members to read your posts.
I changed 'Solns' to 'Solution' in your subject line for you.

Again, welcome to JavaRanch and good luck with your question.
-Ben
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there is anything like Browser timeout?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rahul Bhattacharjee:
Is there is anything like Browser timeout?


Yes, the browser will time-out after a certain duration has passed without receiving a response. But it's generally not configurable, and certainly not from any web-based code.

The solution is to figure out why your request is taking so long and either fix it, or if that is not possible, to run it asynchronously rather than synchronously.
[ September 20, 2006: Message edited by: Bear Bibeault ]
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTP is stateless .It doesnot maintain session and nothing to do with time.
 
Susanta Chatterjee
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rahul Bhattacharjee:
HTTP is stateless .It doesnot maintain session and nothing to do with time.


Rahul, You are right about HTTP is stateless.

But, when a browser sends a request, it keeps a connection open for receiving server response. Here, in this context the question is, how long the browser will keep that connection open while it is waiting for server side response to reach client. This is not generally user configurable - and that is what Bear mentioned.

- Susanta
[ September 20, 2006: Message edited by: Susanta Chatterjee ]
 
apurb sinha
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Frnds I guess with this much discussion at least you are aware of my probs ... is there any way we can fix that. i.e. On my serever side there we have done everything to minnimise time but the query is so heavy that we are helpless. So we need to find a way to keep the client alive till the query executes.
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Bear already mentioned, is it not possible to make this query asynchronous, instead of waiting for the query to complete?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by apurb sinha:
Hey Frnds I guess with this much discussion at least you are aware of my probs ... is there any way we can fix that. i.e. On my serever side there we have done everything to minnimise time but the query is so heavy that we are helpless. So we need to find a way to keep the client alive till the query executes.


I have an example program that shows one way to deal with this.

It works by:
  • Allowing the user to kick off the process (report) from a browser.
  • The server starts the process in a new thread and immediately returns a status page.
  • The status page refreshes itself every n seconds.
  • Each time it refreshes, it checks the status of the process.
  • When the process is finished, the app forwards to the finish page (in your case, the report).


  • In the real world, I would also have the app fire off an email to the user when the report is finished. This would prevent the user from having to stay a his/her workstation until the report is finished.

    Http://simple.souther.us/not-so-simple.html
    Look for Long Running Process.

    Hope it helps.
     
    karthikeyan Chockalingam
    Ranch Hand
    Posts: 259
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    The best solution is as Bear suggested make it async.

    One work around is till the calculation is done make the controller (say servlet) dispatch an auto refreshing JSP (this displays "Please wait. Calculation being done at the server"). Once the calculation is done the result will be posted in a commonly accesible class(which contains a Collection like HashMap) with a unique key to identify (like sessionId or userLoginId). The next time the auto refreshing page submits itself, as the result has been calculated and available, the controller retrievs the result with the unique key, removes data from the Collection and proceeds with the next step.
     
    Richard Green
    Ranch Hand
    Posts: 536
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    are you sure that you meant 'browser timeout' and not 'session timeout'. they are two different things.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!