473,799 Members | 2,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Long Running process

I'm developing an intranet application using W2k server and IE5.5 - 6.x
clients. I've got one particular function that calls a stored procedure to
update a number of records, depending on user input. The problem we have
run into is that this procedure can take a few minutes to complete in
certain circumstances, and of course IIS times out.

I've been doing some searching for a solution, but most of the answers I've
found relate to showing a 'Please wait' message while processing the page,
which doesn't help in this situation. The others I've found relate to using
MSMQ, which would probably help, but leads to a load of testing issues that
I'm not prepared to deal with at the moment.

Are there any other 'common' ways to handle this at the ASP level?

tia,

Bob M..
Jul 19 '05 #1
2 3172
Quote from aspfaq.com (#2194)
How do I prevent my ASP pages from waiting for backend activity?
4,334 requests - last updated Wednesday, August 14, 2002

If you are trying to run an executable or other backend process, see Adrian
Forbes' article:
Executing long-running tasks from ASP (invalid link of
http://www.aspfree.com/authors/adrian/aspexe.asp)

If you are trying to run long-running database tasks, then the following is
designed for a very specific scenario. Your
ASP page should:

1. initiate a long-running command that may cause a browser to time out;
and,
2. not need to show a user results from the command.
This means it should be a page which triggers an event in the database which
is NOT a recordset or other resultsobtainin g
operation, and that the user isn't expecting direct feedback of any kind to
let them know that the process
has finished.
<%
set conn = server.createob ject("ADODB.Con nection")
conn.open "<connectio n string>"
conn.execute "<long-running command>",,&H00 000010
response.write "The command is still running, but I'm not waiting!"
....
%>
You can test this technique by creating a single-column table:
CREATE TABLE dt (dt DATETIME)
And using a command like:

<%
set conn = server.createob ject("ADODB.Con nection")
conn.open "<connectio n string>"
sql = "INSERT dt VALUES(CURRENT_ TIMESTAMP) WAITFOR DELAY '00:00:05' " &_
" INSERT dt VALUES(CURRENT_ TIMESTAMP) WAITFOR DELAY '00:00:05' " &_
" INSERT dt VALUES(CURRENT_ TIMESTAMP)"
response.write now()
conn.execute sql,,&H00000010
'...
%>
Now wait at least 10 seconds, go into the dt table manually, and check out
the differences in the dt column (and
compare to the now() value that you wrote to the browser).
One word of warning: errors get swallowed up by the provider when using
asynchronous methods, so you'll want to
employ this method carefully.

-----------
Ray at work
"Bob Murdoch" <ra***********@ erols.com> wrote in message
news:uv******** ******@TK2MSFTN GP12.phx.gbl...
I'm developing an intranet application using W2k server and IE5.5 - 6.x
clients. I've got one particular function that calls a stored procedure to update a number of records, depending on user input. The problem we have
run into is that this procedure can take a few minutes to complete in
certain circumstances, and of course IIS times out.

I've been doing some searching for a solution, but most of the answers I've found relate to showing a 'Please wait' message while processing the page,
which doesn't help in this situation. The others I've found relate to using MSMQ, which would probably help, but leads to a load of testing issues that I'm not prepared to deal with at the moment.

Are there any other 'common' ways to handle this at the ASP level?

tia,

Bob M..

Jul 19 '05 #2

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote> <%
set conn = server.createob ject("ADODB.Con nection")
conn.open "<connectio n string>"
conn.execute "<long-running command>",,&H00 000010
response.write "The command is still running, but I'm not waiting!"
...
%>


Great, I can get that to work in javascript. The question is, are we
leaking anything, or will we have problems with transactions not committing
with this?

We typically create the connection, start transaction, execute command,
commit, and then close the connection. Just wanna make sure we aren't
causing a leak here.

(btw, I did check Aspfaq.com, but the site seems to be down today),

thanks again,

Bob M..
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
2892
by: Justin Lazanowski | last post by:
Cross posting this question on the recommendation of an I have a .NET application that I am developing in C# I am loading information in from a dataset, and then pushing the dataset to a grid, or other controls depending on the particular form. This application is setup with one MDI parent calling MDI children with the exception of one Modal form (the report viewer). When I run the application and run one of the screens that pulls...
2
3551
by: Steve W | last post by:
Is it possible to keep some communication going between the browser and web server going while waiting for a long running process to finish ? We have one function on our app (ASP.NET / VB.NET) that does a long running update to the database (takes upto 10 mins) and the browser will often time out before it completes. Ideally I'd like to send information back to the browser from the process, but anything that stops the browser timing...
5
3374
by: PontiMax | last post by:
Hi, when I press the OK button of my dialog box a long-running task is initiated. Therefore I would like to make visible a div section right after clicking the button where a user-friendly message is displayed... How can this be done? Can I make the section visible via server-side code? Via Response.Write()? Any examples would be appreciated!
1
6027
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the browser back button, it loads the progress bar again. Any solution to this?
14
23173
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So, we're looking for a way to display the page with a "please wait..." message while the process is running, and then, when the process is done, update the page with the actual results/page content. We have a page that opens another browser/page...
1
2438
by: walterbyrd | last post by:
I understand that Python has them, but PHP doesn't. I think that is because mod_php is built into apache, but mod_python is not usually in apache. If mod_python was built into apache, would python still have long running processes (LRP)? Do LRPs have to do with a Python interpreter running all the time? Or is it something else? I also understand that LRPs are the reason that shared hosting is less
4
2854
by: commander_coder | last post by:
Hello, I write a lot of CGI scripts, in Python of course. Now I need to convert some to long-running processes. I'm having trouble finding resources about the best practices to do that. I've found a lot of email discussions that say something like, "You need to educate yourself about the differences when you have long- running processes" but I've not had a lot of luck with finding things that explain the differences. I've seen some...
2
1634
by: =?Utf-8?B?QWxwaGFwYWdl?= | last post by:
Hello, I have a class MyWorker. Each time I create a new instance of MyWorker, I queue it to the ThreadPool. So, 1 MyWorker object is pooled and belongs to its thread (there can't have 2 MyWorker in 1 thread from the ThreadPool). When MyWorker is initialized or instanciate, I use an asynchronous delegate to execute a long running process (depending on users, the job can be quicker). So, this async delegate will use or create a new...
32
1713
by: John Wright | last post by:
I have a long process I run that needs to be complete before the user can continue. I can change the cursor to an hourglass, but I want to update the Status Strip on the bottom during the process. I set the statusstrip label to "Downloading...", but it will not show up on the form. I need to display this message before it starts the process. I can put a thread.sleep for 1 second after I do the initial process, but that seems sloppy to me. ...
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.