473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Preform a long lasting Web Services task

Dear All,

I have problems on doing some long lasting job in a web services.

Let me first provide some background information first.

I have a ASP.NET web page, which will call another Web Services to preform a
task. Since that Web Service Task last for a quiet long time (eg. 1 hr). If I
return the result after the long task, I am sure that the client browser will
be timeout. So I decided to use threading inside the Web Service. My idea is,
Start a new child thread to preform the task inside the Web Service, And the
Main Thread will give a reply to the client browser said, "Your request is
now processing".

My problem is I sometimes get a strange exception from the web service as
shown below:

System.CannotUnloadAppDomainException was unhandled
Message="Error while unloading appdomain. (Exception from HRESULT:
0x80131015)"
Source="mscorlib"
StackTrace:
at System.AppDomain.Unload(AppDomain domain)
at System.Web.HttpRuntime.ReleaseResourcesAndUnloadAp pDomain(Object
state)
at
System.Threading._ThreadPoolWaitCallback.WaitCallb ack_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at
System.Threading._ThreadPoolWaitCallback.PerformWa itCallback(Object state)

I suspect that it' cos by the Main Thread is being killed or timeout. I did
try to set the <SessionState timeout=70 />, But seems no improvment is made.

May anybody know how to deal with this issue ?

Moveover, I've seem a very useful artical in this forum about the Life
Cycle of the ASP.NET. Can anybody post the similar artical about the Web
Services?

Many Thx !

Nov 13 '06 #1
3 4330
Never done this but I would likely prefer to handle this processing in a
separate service rather than to use an ASP.NET background task. Here ASP.NET
and some long processing that is loosely related to ASP.NET are tightly tied
(for example even if nobody browse the site you are not able to restart the
web application). This is perhaps what you see here.

I would use async/background processing in ASP.NET only if I expect a quick
enough response to be returned to the browser...

For now, you could try to launch such as background process by calling your
service and then try to manually restart the web application to see if you
have the same behavior...

Good luck.
"lai_waiman" <la********@discussions.microsoft.coma écrit dans le message
de news: 4A**********************************@microsoft.com...
Dear All,

I have problems on doing some long lasting job in a web services.

Let me first provide some background information first.

I have a ASP.NET web page, which will call another Web Services to preform
a
task. Since that Web Service Task last for a quiet long time (eg. 1 hr).
If I
return the result after the long task, I am sure that the client browser
will
be timeout. So I decided to use threading inside the Web Service. My idea
is,
Start a new child thread to preform the task inside the Web Service, And
the
Main Thread will give a reply to the client browser said, "Your request is
now processing".

My problem is I sometimes get a strange exception from the web service as
shown below:

System.CannotUnloadAppDomainException was unhandled
Message="Error while unloading appdomain. (Exception from HRESULT:
0x80131015)"
Source="mscorlib"
StackTrace:
at System.AppDomain.Unload(AppDomain domain)
at System.Web.HttpRuntime.ReleaseResourcesAndUnloadAp pDomain(Object
state)
at
System.Threading._ThreadPoolWaitCallback.WaitCallb ack_Context(Object
state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at
System.Threading._ThreadPoolWaitCallback.PerformWa itCallback(Object state)

I suspect that it' cos by the Main Thread is being killed or timeout. I
did
try to set the <SessionState timeout=70 />, But seems no improvment is
made.

May anybody know how to deal with this issue ?

Moveover, I've seem a very useful artical in this forum about the Life
Cycle of the ASP.NET. Can anybody post the similar artical about the Web
Services?

Many Thx !

Nov 13 '06 #2
Thanks for ur advice, Patrice.

Can you explain more about how to make my long running task into background
process. And how can I call the background process?
Thanks !
"Patrice" wrote:
Never done this but I would likely prefer to handle this processing in a
separate service rather than to use an ASP.NET background task. Here ASP.NET
and some long processing that is loosely related to ASP.NET are tightly tied
(for example even if nobody browse the site you are not able to restart the
web application). This is perhaps what you see here.

I would use async/background processing in ASP.NET only if I expect a quick
enough response to be returned to the browser...

For now, you could try to launch such as background process by calling your
service and then try to manually restart the web application to see if you
have the same behavior...

Good luck.
"lai_waiman" <la********@discussions.microsoft.coma écrit dans le message
de news: 4A**********************************@microsoft.com...
Dear All,

I have problems on doing some long lasting job in a web services.

Let me first provide some background information first.

I have a ASP.NET web page, which will call another Web Services to preform
a
task. Since that Web Service Task last for a quiet long time (eg. 1 hr).
If I
return the result after the long task, I am sure that the client browser
will
be timeout. So I decided to use threading inside the Web Service. My idea
is,
Start a new child thread to preform the task inside the Web Service, And
the
Main Thread will give a reply to the client browser said, "Your request is
now processing".

My problem is I sometimes get a strange exception from the web service as
shown below:

System.CannotUnloadAppDomainException was unhandled
Message="Error while unloading appdomain. (Exception from HRESULT:
0x80131015)"
Source="mscorlib"
StackTrace:
at System.AppDomain.Unload(AppDomain domain)
at System.Web.HttpRuntime.ReleaseResourcesAndUnloadAp pDomain(Object
state)
at
System.Threading._ThreadPoolWaitCallback.WaitCallb ack_Context(Object
state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at
System.Threading._ThreadPoolWaitCallback.PerformWa itCallback(Object state)

I suspect that it' cos by the Main Thread is being killed or timeout. I
did
try to set the <SessionState timeout=70 />, But seems no improvment is
made.

May anybody know how to deal with this issue ?

Moveover, I've seem a very useful artical in this forum about the Life
Cycle of the ASP.NET. Can anybody post the similar artical about the Web
Services?

Many Thx !


Nov 14 '06 #3
For example the site could write those work items into a database table. A
Windows service (http://www.codeproject.com/dotnet/si...owsservice.asp)
or even just a regular app launched regularly with the windows scheduler
could then read those items and perform the corresponding work (and then
flag of course the item as done).

This way you don't care to restart the site, or even the computer....

You could also check
http://www.irishdev.com/blogs/kieran...tut1part1.aspx
etc... and all similar schemes (that is the long running job is just
"queued" by the web site and doing the hard work is done by another
application).
--
Patrice

"lai_waiman" <la*******@discussions.microsoft.coma écrit dans le message
de news: 0A**********************************@microsoft.com...
Thanks for ur advice, Patrice.

Can you explain more about how to make my long running task into
background
process. And how can I call the background process?
Thanks !
"Patrice" wrote:
>Never done this but I would likely prefer to handle this processing in a
separate service rather than to use an ASP.NET background task. Here
ASP.NET
and some long processing that is loosely related to ASP.NET are tightly
tied
(for example even if nobody browse the site you are not able to restart
the
web application). This is perhaps what you see here.

I would use async/background processing in ASP.NET only if I expect a
quick
enough response to be returned to the browser...

For now, you could try to launch such as background process by calling
your
service and then try to manually restart the web application to see if
you
have the same behavior...

Good luck.
"lai_waiman" <la********@discussions.microsoft.coma écrit dans le
message
de news: 4A**********************************@microsoft.com...
Dear All,

I have problems on doing some long lasting job in a web services.

Let me first provide some background information first.

I have a ASP.NET web page, which will call another Web Services to
preform
a
task. Since that Web Service Task last for a quiet long time (eg. 1
hr).
If I
return the result after the long task, I am sure that the client
browser
will
be timeout. So I decided to use threading inside the Web Service. My
idea
is,
Start a new child thread to preform the task inside the Web Service,
And
the
Main Thread will give a reply to the client browser said, "Your request
is
now processing".

My problem is I sometimes get a strange exception from the web service
as
shown below:

System.CannotUnloadAppDomainException was unhandled
Message="Error while unloading appdomain. (Exception from HRESULT:
0x80131015)"
Source="mscorlib"
StackTrace:
at System.AppDomain.Unload(AppDomain domain)
at
System.Web.HttpRuntime.ReleaseResourcesAndUnloadAp pDomain(Object
state)
at
System.Threading._ThreadPoolWaitCallback.WaitCallb ack_Context(Object
state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at
System.Threading._ThreadPoolWaitCallback.PerformWa itCallback(Object
state)

I suspect that it' cos by the Main Thread is being killed or timeout. I
did
try to set the <SessionState timeout=70 />, But seems no improvment is
made.

May anybody know how to deal with this issue ?

Moveover, I've seem a very useful artical in this forum about the Life
Cycle of the ASP.NET. Can anybody post the similar artical about the
Web
Services?

Many Thx !



Nov 14 '06 #4

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

Similar topics

4
by: Andy Leszczynski | last post by:
I need a HTTP server handling long lasting requests e.g. 10-30 seconds. Below is a pice of the code. In order to make the server reponsive while handling othere requests I use...
29
by: pb648174 | last post by:
I have a very long transaction that runs on the same database that other users need to use for existing data. I don't care if they see data from the transaction before it is done and am only using...
5
by: Steve M | last post by:
Why are my sessions lasting so long? I have them set to 20 minute timeout in config file? The Session_End event is getting called an hour or more sometimes--well after the user has stopped...
18
by: Larry Herbinaux | last post by:
I'm having issues with garbage collection with my long-standing service process. If you could review and point me in the right direction it would be of great help. If there are any helpful...
3
by: nj609eagle | last post by:
Recently and without warning, a report that I was using in my VB.NET 2003 application started to take 10 minutes to load. It also take thisamount of time to open in the deisgner. I'm using a...
1
by: Ralph | last post by:
Okay I have a website where the user is going to hit a button to kick off a process that is going to take a long amount of time. Is there anyway without using AJAX, or possibly a windows control on...
14
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,...
0
by: sirmoreno | last post by:
Hi, In my web site I have some long tasks that I want to call without delaying the page rendering - without making the thread that handels the page request wait for the long task to end. I...
0
by: thesti | last post by:
hello, i'm trying to import data from an excel file to a SQL Server 2005 table using the Integration Services Project. i have Visual Studio 2005 installed as i drag the data flow task and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.