Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Correct Page Timing Out (or other suggestions welcome)

Status
Not open for further replies.

DrinkN1

Programmer
Apr 15, 2002
23
US
Background:
User has an ASPX page to input several report parameters.

The Input Page has an OWC component that reads in from an XML Data Source.

I have an ASPX page that Generates the XML Data for the OWC control.

Process: User enters parameters, clicks button to generate report. OWC control is rendered with input being from the XMLsource provided by my XML only page.

In general, this is working fine.

However, if the user selects a report with a tremendous amount of detail, the aspx page that generates the XML Document appears to time out after approximately 5 minutes.

One example of this data is a query that returns a dataset with 408 rows. EACH of the 408 rows are parsed into individual 30 row records in the OWC object. Each OWC row has 27 cells filled. So, in this example, the XML datafile needs to create data for 330,480 individual cells.

The user does not mind waiting the 1/2 hour (or whatever the time period is) to generate the page. I just need to get it to generate!

Suggestions would be most appreciated.

Thanks!
 
try doing a response.write("") somewhere in your code, probably in a loop. The problem is that ASP.NET sets a timeout limit on a thread executing with no response. By doing a response.write, you will be letting the server know that it is still working. You don't really want to increase that time out value because you do want ASP.NET to shut down any threads that really are stuck in an infinite loop or something like that.
 
Not to contradict, but don't forget that we are multi-threaded in the .NET world now. And that goes for ASP.NET, too!

If I have a long running process, I will delegate a worker thread to do my work, and set him into motion. I will then return a response to my client saying:

"Please wait while your work is processed"

and then set that page to postback in 10 seconds. On postback, I'll check to see if the worker thread is through w/ his work. If he is, then I'll let the user know. If not, I start the loop over again.

I'll normally just get the worker thread to mark a flag when he's through somewhere. Maybe a file will be written to a directory on the server, and my main execution thread can check to see if it's there or not. Or maybe he'll knock a database value that my main execution thread can check... anything to just signify that he's through with his work.

And at that point, you go ahead and let the user know.

Here's an article for you:

And then the motherload of information about it:

The Response.Write() way to do it was how you would do this in ASP Classic, and it does still work. But we have a much much much more powerful tool at our disposal now.

:)
paul

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Thanks for both of your posts.... I have it working in 20 seconds now. Solution below.

I was unable to to the "Response.Write" recommendation, as the page that was timing out was generating an XML content only. When I tried the .write(" ") the OWC would error, as the page content type was set to XML and was confusing the OWC.

I actually tried doing that before you posted, but I kept getting a "object not marked as serializable" error. I have NO idea what the heck that is. Thank you for the articles, I will read them momentarily.

My Solution:
The problem was in the OWC control. Handling that many formatting issues was horrid. I now have the most complicated query working in 20 seconds. Here's how:

I generated a CSV text file of the entire report directly to a temp file. Then I opened the OWC control, imported the file, did a couple of formatting commands, and viola, instant report without the wait.

Thanks again everyone!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top