Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Question About Application_Start in Global.asax and async functions

Reply
Thread Tools

Question About Application_Start in Global.asax and async functions

 
 
Bob Johnson
Guest
Posts: n/a
 
      11-13-2003
Hello people.

Short background -- I am constructing a web site that will have several
display tabs that are hooked up to different datatables in a SQL server.
Some of these tables are VERY large -- several million+ records. The tables
have records that are timestamped over several years and
months/quarter/weeks... depending on the individual table they can have
anywhere between 30 and 300 geography/time combinations.

What I would like to do in Application_Start is to create several metadata
objects (datasets) that control what the drop down choices are for the user
to select on each of the main data pages. The problem is sometimes filling
these datatables takes 30-40 seconds+.

So: how do I create something in application_start that fires off a
function that creates and populates my application level objects in a "fire
& forget " method. I can do threading and async calls all day long in win32
forms programming -- this is the first time though I've needed it in ASP.net

Thnx

Bob J


 
Reply With Quote
 
 
 
 
George Durzi
Guest
Posts: n/a
 
      11-13-2003
Here are some resources on Threading in ASP.NET using System.Threading

http://msdn.microsoft.com/library/de...mthreading.asp
http://msdn.microsoft.com/library/de...eadpooling.asp

Here's a quick example. In this example, I'm writing to my db, and at the
same time, wanna email the user. So here's what I do:

In my button click event
{
ForkThreadSendInviteEmails();
Response.Redirect("default.aspx", true);
}

private void ForkThreadSendInviteEmails()
{
Thread thEmailInvoice = new Thread(new ThreadStart(SendInviteEmails));
thEmailInvoice.Priority = ThreadPriority.AboveNormal;
thEmailInvoice.Start();
}
"Bob Johnson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello people.
>
> Short background -- I am constructing a web site that will have several
> display tabs that are hooked up to different datatables in a SQL server.
> Some of these tables are VERY large -- several million+ records. The

tables
> have records that are timestamped over several years and
> months/quarter/weeks... depending on the individual table they can have
> anywhere between 30 and 300 geography/time combinations.
>
> What I would like to do in Application_Start is to create several metadata
> objects (datasets) that control what the drop down choices are for the

user
> to select on each of the main data pages. The problem is sometimes

filling
> these datatables takes 30-40 seconds+.
>
> So: how do I create something in application_start that fires off a
> function that creates and populates my application level objects in a

"fire
> & forget " method. I can do threading and async calls all day long in

win32
> forms programming -- this is the first time though I've needed it in

ASP.net
>
> Thnx
>
> Bob J
>
>



 
Reply With Quote
 
 
 
 
George Durzi
Guest
Posts: n/a
 
      11-13-2003
sorry, I hit Sendtoo soon.

In my ForkThreadSendInviteEmails function, you see the line:
Thread thEmailInvoice = new Thread(new ThreadStart(SendInviteEmails));

You would also have to implement the SendInviteEmails function.


"George Durzi" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Here are some resources on Threading in ASP.NET using System.Threading
>
>

http://msdn.microsoft.com/library/de...mthreading.asp
>

http://msdn.microsoft.com/library/de...eadpooling.asp
>
> Here's a quick example. In this example, I'm writing to my db, and at the
> same time, wanna email the user. So here's what I do:
>
> In my button click event
> {
> ForkThreadSendInviteEmails();
> Response.Redirect("default.aspx", true);
> }
>
> private void ForkThreadSendInviteEmails()
> {
> Thread thEmailInvoice = new Thread(new ThreadStart(SendInviteEmails));
> thEmailInvoice.Priority = ThreadPriority.AboveNormal;
> thEmailInvoice.Start();
> }
> "Bob Johnson" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello people.
> >
> > Short background -- I am constructing a web site that will have several
> > display tabs that are hooked up to different datatables in a SQL server.
> > Some of these tables are VERY large -- several million+ records. The

> tables
> > have records that are timestamped over several years and
> > months/quarter/weeks... depending on the individual table they can have
> > anywhere between 30 and 300 geography/time combinations.
> >
> > What I would like to do in Application_Start is to create several

metadata
> > objects (datasets) that control what the drop down choices are for the

> user
> > to select on each of the main data pages. The problem is sometimes

> filling
> > these datatables takes 30-40 seconds+.
> >
> > So: how do I create something in application_start that fires off a
> > function that creates and populates my application level objects in a

> "fire
> > & forget " method. I can do threading and async calls all day long in

> win32
> > forms programming -- this is the first time though I've needed it in

> ASP.net
> >
> > Thnx
> >
> > Bob J
> >
> >

>
>



 
Reply With Quote
 
Bob Johnson
Guest
Posts: n/a
 
      11-13-2003
So the threading works exactly the same way as it does in windows forms?

"George Durzi" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Here are some resources on Threading in ASP.NET using System.Threading
>
>

http://msdn.microsoft.com/library/de...mthreading.asp
>

http://msdn.microsoft.com/library/de...eadpooling.asp
>
> Here's a quick example. In this example, I'm writing to my db, and at the
> same time, wanna email the user. So here's what I do:
>
> In my button click event
> {
> ForkThreadSendInviteEmails();
> Response.Redirect("default.aspx", true);
> }
>
> private void ForkThreadSendInviteEmails()
> {
> Thread thEmailInvoice = new Thread(new ThreadStart(SendInviteEmails));
> thEmailInvoice.Priority = ThreadPriority.AboveNormal;
> thEmailInvoice.Start();
> }
> "Bob Johnson" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello people.
> >
> > Short background -- I am constructing a web site that will have several
> > display tabs that are hooked up to different datatables in a SQL server.
> > Some of these tables are VERY large -- several million+ records. The

> tables
> > have records that are timestamped over several years and
> > months/quarter/weeks... depending on the individual table they can have
> > anywhere between 30 and 300 geography/time combinations.
> >
> > What I would like to do in Application_Start is to create several

metadata
> > objects (datasets) that control what the drop down choices are for the

> user
> > to select on each of the main data pages. The problem is sometimes

> filling
> > these datatables takes 30-40 seconds+.
> >
> > So: how do I create something in application_start that fires off a
> > function that creates and populates my application level objects in a

> "fire
> > & forget " method. I can do threading and async calls all day long in

> win32
> > forms programming -- this is the first time though I've needed it in

> ASP.net
> >
> > Thnx
> >
> > Bob J
> >
> >

>
>



 
Reply With Quote
 
George Durzi
Guest
Posts: n/a
 
      11-13-2003
I have no experience with Windows Forms, but they're both using
System.Threading.

"Bob Johnson" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> So the threading works exactly the same way as it does in windows forms?
>
> "George Durzi" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Here are some resources on Threading in ASP.NET using System.Threading
> >
> >

>

http://msdn.microsoft.com/library/de...mthreading.asp
> >

>

http://msdn.microsoft.com/library/de...eadpooling.asp
> >
> > Here's a quick example. In this example, I'm writing to my db, and at

the
> > same time, wanna email the user. So here's what I do:
> >
> > In my button click event
> > {
> > ForkThreadSendInviteEmails();
> > Response.Redirect("default.aspx", true);
> > }
> >
> > private void ForkThreadSendInviteEmails()
> > {
> > Thread thEmailInvoice = new Thread(new

ThreadStart(SendInviteEmails));
> > thEmailInvoice.Priority = ThreadPriority.AboveNormal;
> > thEmailInvoice.Start();
> > }
> > "Bob Johnson" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hello people.
> > >
> > > Short background -- I am constructing a web site that will have

several
> > > display tabs that are hooked up to different datatables in a SQL

server.
> > > Some of these tables are VERY large -- several million+ records. The

> > tables
> > > have records that are timestamped over several years and
> > > months/quarter/weeks... depending on the individual table they can

have
> > > anywhere between 30 and 300 geography/time combinations.
> > >
> > > What I would like to do in Application_Start is to create several

> metadata
> > > objects (datasets) that control what the drop down choices are for the

> > user
> > > to select on each of the main data pages. The problem is sometimes

> > filling
> > > these datatables takes 30-40 seconds+.
> > >
> > > So: how do I create something in application_start that fires off a
> > > function that creates and populates my application level objects in a

> > "fire
> > > & forget " method. I can do threading and async calls all day long in

> > win32
> > > forms programming -- this is the first time though I've needed it in

> > ASP.net
> > >
> > > Thnx
> > >
> > > Bob J
> > >
> > >

> >
> >

>
>



 
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
scope of local variables across async method calls with anon functions John Davison Javascript 1 03-06-2007 05:25 PM
Newbie: async mode dedicated versus async mode interactive!! Pink_Floyd Cisco 4 06-16-2006 12:16 AM
Async webservice call in async webpage (.Net 2.0) does not return Steven ASP .Net Web Services 0 11-30-2005 01:06 AM
Async-signal safe functions in signal handlers (unix) Michael Pronath Python 1 01-03-2005 01:10 PM
please help me in distinguish redefining functions, overloading functions and overriding functions. Xiangliang Meng C++ 1 06-21-2004 03:11 AM



Advertisments