Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 1st, 2008, 12:40 PM
Registered User
 
Join Date: Aug 2008
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default .NET Remoting

Guys,

I have a web application where the user is going to save a query template. Then I need to take this query template and run a SQL query in the backend which can some times take may be 1 hour or so.

The way I think is there will be a windows service which will take this query template and run the query in backend and then write a Excel output file in a folder.

So when the user submits a query request I need to start this windows service.

Can this be done using .NET Remoting or I need to do this in a different way ?

Any ideas are welcome here ?

Thanks

Pr.
  #2 (permalink)  
Old August 1st, 2008, 01:00 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If you already have a Windows service that is ready to deal with this, you certainly could connect to it with remoting.

You could solve this problem by simply spinning up another thread from the web page. The processing can be done within the web application (i.e. the asp.net worker process "aspnet_wp.exe"). Just prepare and start a new thread to handle the process and let your page return to the user with the appropriate notification that the request started. This eliminates the need to create a service app and communicate with remoting, etc.

-Peter
compiledthoughts.com
  #3 (permalink)  
Old August 4th, 2008, 12:50 PM
Registered User
 
Join Date: Aug 2008
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The windows service is not there yet. If I implement a new thread what happens if the user closes the page ? will it still run in the background ?
The reason for the windows service is the query which it runs is going to take a long time to run in some cases may be an hour. Once I get the results, I need to write to an excel file and send an email back to the user that the output is ready.

Can all this be done using your method or Windows service is the right way to go about doing this ?

Also is there any way you can give me any examples. That will me a lot.

Thanks

Pr

  #4 (permalink)  
Old August 5th, 2008, 02:31 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The thread that processes your page request lives inside the asp.net worker process, so would the thread that you spawn off to run this background process. The user could close the page, their browser and turn off their computer and the thread you spawn off will still be running.

Look for some examples involving the Thread and ThreadStart class and you should find what you need. There are lots of examples online about launching threads.

-Peter
compiledthoughts.com
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET Remoting manisha2578 VB.NET 0 May 9th, 2005 11:23 PM
.NET Remoting vikyjain General .NET 0 March 7th, 2005 12:50 AM
.NET Remoting application in vb.net Tek4VB .NET Web Services 6 November 19th, 2003 09:59 AM
Remoting (.Net) Indian Ocean .NET Web Services 6 November 12th, 2003 03:27 PM
.NET Enterprise Development in VB.NET Remoting burkert All Other Wrox Books 0 June 24th, 2003 09:04 AM



All times are GMT -4. The time now is 07:24 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.