• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Script Time Out

 
Shannon Sims
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have page that requires a lot of data from the db, therefore the page times out. How does one set a page so that it does not time out before the data gets retrieved? Is there a setting on the response???
Any help is greatly appreciated!
Thank you!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless I miss my guess, it's the browser timing out. And I do not believe that there's a way to tell it to not do so, or to adjust the value from the server end.
Your best bet would be to design a UI that pages through the large dataset so that you are not sending so much data at a time. This will not only help your timeout problem, it's also just good UI. After all, is that much data really useful to your users? Or will it just overwhelm them?
The subject of paging datasets had been discussed in these forums many times. If you search for terms like "paging" in this forum, as well as possibly the Servlets, JDBC, and HTML forums I'm sure you'll find lots of helpful information.
hth,
bear
 
Shannon Sims
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The large dataset isn't the problem, it's waiting for the data to return from the database. There is a link on a page that the user clicks to retrieve a report which can then be downloaded to the client. The problem is once they click on the link, a SQL statement is executed to retrieve the large dataset to be returned back to the calling page ( which cause the page time out). The normal behavior is that the report gets builted and zipped up and the user can then downloaded the file. Unfortunately, the large amount of data is needed.
Using ".asp" you can programmatically set a page from timing out using Server.ScriptTimeout = 180 (seconds). Isn't there a similar setting for .jsp pages?
Thank you.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems to me you should execute that SQL from a separate Thread - presumably in something like a Bean. Then your initial request can produce a response "Working"....
We have this sort of thing come up all the time, search the recent posts.
I suspect your ASP example is not changing the browser timeout.
Bill
 
toma lam
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heya,
Maybe you can also tweak the query a bit, or break it up to avoid the time out. If you're using SQL Server, it may execute faster if you put it all into a stored procedure; that is if you have several different queries happening to get your results.
Other database items to consider could be indexes.
 
Scott Duncan
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not understand how calling Server.ScriptTimeout will solve your problem. You need to retrieve a large amount of data in a specified amount of time. Otherwise, as already mentioned, the browser will time out. Also mentioned, there is no way to correct this safely without monkeying around with the browser config files and ultimately messing something up. Best bet is to kick off a thread and let it run it's course.
 
Shannon Sims
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for everyone's replies. It looks like we (my team) have decided to leave it up to our DBAs to figure out how we can modify our store procedure to retreive the data more quickly.
Thanks again!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic