Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Background processing in ASP.NET page

Reply
Thread Tools

Background processing in ASP.NET page

 
 
Hilmar Bunjes
Guest
Posts: n/a
 
      06-04-2008
Hi,
I'm working on a web application in ASP.NET 3.5 and need some help with
processing stuff in the background.

The user who visits a web page can make reservations. Each reservation
will result in a notification for the user and an involved company.
Sending the notifications can take some seconds but the user shouldn't
need to wait for the page. So the only way to handle this is AFAIK to do
some background processing that is not connected to the page processing
itself.

In the application I store all notifications that need to be sent in the
database so another process can take them from there and send them.
However I'm unsure how to realize this process. Due to the hosted
environment so there is no chance to deploy a Windows service.

The following solutions seem to be possible:
1. Create a QueueUserWorkItem that handles the process:
ThreadPool.QueueUserWorkItem(new WaitCallback(SendNotifications));

A problem seems to be that under high load the ASP.NET thread pool can
run out of processes.

2. Create a background thread that handles the process:
Thread thread = new Thread(new ThreadStart(SendNotifications));
thread.IsBackground = true;
thread.Start();

3. Create a System.Threading.Timer in global.asax that regularly looks
(like every 5 min) for notifications to be sent and sends them.

Has anyone tips which of these solutions seems to be the best in this
case or maybe there is even another one I haven't thought of?

Thanks,
Hilmar
 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      06-04-2008
Google for Asynchronous Operations in ASP.NET. This could be the starting
point:

http://www.beansoftware.com/asp.net-...n-pattern.aspx


--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Hilmar Bunjes" <(E-Mail Removed)> wrote in message
news:4846a19b$0$7545$(E-Mail Removed)-online.net...
> Hi,
> I'm working on a web application in ASP.NET 3.5 and need some help with
> processing stuff in the background.
>
> The user who visits a web page can make reservations. Each reservation
> will result in a notification for the user and an involved company.
> Sending the notifications can take some seconds but the user shouldn't
> need to wait for the page. So the only way to handle this is AFAIK to do
> some background processing that is not connected to the page processing
> itself.
>
> In the application I store all notifications that need to be sent in the
> database so another process can take them from there and send them.
> However I'm unsure how to realize this process. Due to the hosted
> environment so there is no chance to deploy a Windows service.
>
> The following solutions seem to be possible:
> 1. Create a QueueUserWorkItem that handles the process:
> ThreadPool.QueueUserWorkItem(new WaitCallback(SendNotifications));
>
> A problem seems to be that under high load the ASP.NET thread pool can run
> out of processes.
>
> 2. Create a background thread that handles the process:
> Thread thread = new Thread(new ThreadStart(SendNotifications));
> thread.IsBackground = true;
> thread.Start();
>
> 3. Create a System.Threading.Timer in global.asax that regularly looks
> (like every 5 min) for notifications to be sent and sends them.
>
> Has anyone tips which of these solutions seems to be the best in this case
> or maybe there is even another one I haven't thought of?
>
> Thanks,
> Hilmar



 
Reply With Quote
 
 
 
 
Peter Bromberg [C# MVP]
Guest
Posts: n/a
 
      06-04-2008
This article http://www.eggheadcafe.com/articles/20040916.asp may provide
some direction on how to use an HttpModule with a Timer to do polling.
--Peter
"Hilmar Bunjes" <(E-Mail Removed)> wrote in message
news:4846a19b$0$7545$(E-Mail Removed)-online.net...
> Hi,
> I'm working on a web application in ASP.NET 3.5 and need some help with
> processing stuff in the background.
>
> The user who visits a web page can make reservations. Each reservation
> will result in a notification for the user and an involved company.
> Sending the notifications can take some seconds but the user shouldn't
> need to wait for the page. So the only way to handle this is AFAIK to do
> some background processing that is not connected to the page processing
> itself.
>
> In the application I store all notifications that need to be sent in the
> database so another process can take them from there and send them.
> However I'm unsure how to realize this process. Due to the hosted
> environment so there is no chance to deploy a Windows service.
>
> The following solutions seem to be possible:
> 1. Create a QueueUserWorkItem that handles the process:
> ThreadPool.QueueUserWorkItem(new WaitCallback(SendNotifications));
>
> A problem seems to be that under high load the ASP.NET thread pool can run
> out of processes.
>
> 2. Create a background thread that handles the process:
> Thread thread = new Thread(new ThreadStart(SendNotifications));
> thread.IsBackground = true;
> thread.Start();
>
> 3. Create a System.Threading.Timer in global.asax that regularly looks
> (like every 5 min) for notifications to be sent and sends them.
>
> Has anyone tips which of these solutions seems to be the best in this case
> or maybe there is even another one I haven't thought of?
>
> Thanks,
> Hilmar


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report "The request could not be submitted for background processing." Rocio ASP .Net 0 10-28-2005 05:49 PM
Post-Processing RAW vs Post-Processing TIFF Mike Henley Digital Photography 42 01-30-2005 08:26 AM
Question: processing HTML, re-write default processing action of many tags Hubert Hung-Hsien Chang Python 2 09-17-2004 03:10 PM
Crystal Reports For .Net - Error in File. The request could not be submitted for background processing. =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmEuIEo=?= ASP .Net 1 05-20-2004 04:16 PM
Background processing of DLL =?Utf-8?B?UlI=?= ASP .Net 1 02-26-2004 06:43 PM



Advertisments