Dealing with Long running tasks in ASP.NET app

L

LP

Hello,

I am supporting one ASP.NET application. A web form in this application
updates records in SQL Server db through a SP. Usually this SP doesn't take
more than 5 sec, but time to time it slows down to 1 to 5 min. Then DBA does
some "magic" with indexes and it goes back down to 5 sec. again.
I want to overhaul a code-behind class, so when updates happen it starts a
new thread and then somehow "sends" update status to the user. I realize
this design is not the best solution or is it? and so many things can go
wrong if that thread fails, and I have no idea how to notify the user when
update completes, etc...
Has anyone had to deal with this kind of situation? How as it handled, what
is the best solution for this problem?

Thank you
 
K

Kevin Spencer

Google "ASP.Net Progress". Tons of info available.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
L

LP

Thanks.

The problem is this application is "Record Review" application, after 1
record is updated, move to the next one. So I am not sure if progress bar is
a good idea. I was thinking update one record but move to the next one
without waiting for update to finish. If that makes sense?
 
K

Kevin Spencer

new thread and then somehow "sends" update status to the user. I realize
It's the same principle, whether you use a Progress bar or simply notify the
user when the process is finished. The principle is that the client must
poll the server (PostBack) to figure out whether or not the process has
finished, or must spit out HTML in chunks at a time until the process is
finished.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top