472,102 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

restart webservice

hi guru's
I want to restart my webservice when ever it throws an exception that isn't
cought. can i do that by web.config or iss or how ??
Nov 23 '05 #1
8 9208
What exactly do you mean when you say restart? You always get a new
instance of your web service class for every new incoming request. Why
do you want to restart the service?

You would have to restart the ASP.Net or the IIS worker process which
would affect the availability of your web service and potentially other
web applications on that serve.

Also you would need to run undo an account with administrator
privileges. Is that really something you want to do?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke************************@discussions.micr osoft.com]
Posted At: Monday, December 27, 2004 4:14 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: restart webservice
Subject: restart webservice

hi guru's
I want to restart my webservice when ever it throws an exception that
isn't
cought. can i do that by web.config or iss or how ??


Nov 23 '05 #2
I want to restart, because that is my best guess, When i get an exception
thrown it is from the db I'm connecting to and I think i should kill the db
connection, because the db ties up licenses. When it happens during debug I
kill the aspnet_wp.exe process and all the licenses are released.

"Christoph Schittko [MVP]" wrote:
What exactly do you mean when you say restart? You always get a new
instance of your web service class for every new incoming request. Why
do you want to restart the service?

You would have to restart the ASP.Net or the IIS worker process which
would affect the availability of your web service and potentially other
web applications on that serve.

Also you would need to run undo an account with administrator
privileges. Is that really something you want to do?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke************************@discussions.micr osoft.com]
Posted At: Monday, December 27, 2004 4:14 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: restart webservice
Subject: restart webservice

hi guru's
I want to restart my webservice when ever it throws an exception that
isn't
cought. can i do that by web.config or iss or how ??


Nov 23 '05 #3
I've just been looking around the user on my computer, ASPNET is appearently
only used for running the aspnet_wp process, and i could set appearently set
som times to shorter than ever on my iss's properties.
Which i guess will end the session and close the application and retarting
it again. ( and herby freeing licenses)

"Christoph Schittko [MVP]" wrote:
What exactly do you mean when you say restart? You always get a new
instance of your web service class for every new incoming request. Why
do you want to restart the service?

You would have to restart the ASP.Net or the IIS worker process which
would affect the availability of your web service and potentially other
web applications on that serve.

Also you would need to run undo an account with administrator
privileges. Is that really something you want to do?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke************************@discussions.micr osoft.com]
Posted At: Monday, December 27, 2004 4:14 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: restart webservice
Subject: restart webservice

hi guru's
I want to restart my webservice when ever it throws an exception that
isn't
cought. can i do that by web.config or iss or how ??


Nov 23 '05 #4
It sounds like you are storing database connections (or objects that
hold open database connections) in the session state? If that's the case
you need to design your application to eliminate the root cause of your
problems instead of addressing the symptom by killing the worker
process.

You __have to__ follow the recommended usage for database connections,
i.e. call open as late as possible, execute your SQL and close/dispose
the connection. Otherwise you will see the problems you're reporting.

Killing the worker process will kill all sessions for all web
applications running in that instance. You can never be sure that you
are not impacting other users of other applications when you just kill
the process.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke************************@discussions.micr osoft.com]
Posted At: Tuesday, December 28, 2004 7:35 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: restart webservice
Subject: Re: restart webservice

I've just been looking around the user on my computer, ASPNET is
appearently
only used for running the aspnet_wp process, and i could set appearently set
som times to shorter than ever on my iss's properties.
Which i guess will end the session and close the application and retarting it again. ( and herby freeing licenses)

"Christoph Schittko [MVP]" wrote:
What exactly do you mean when you say restart? You always get a new
instance of your web service class for every new incoming request. Why do you want to restart the service?

You would have to restart the ASP.Net or the IIS worker process which would affect the availability of your web service and potentially other web applications on that serve.

Also you would need to run undo an account with administrator
privileges. Is that really something you want to do?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke************************@discussions.micr osoft.com]
Posted At: Monday, December 27, 2004 4:14 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: restart webservice
Subject: restart webservice

hi guru's
I want to restart my webservice when ever it throws an exception that isn't
cought. can i do that by web.config or iss or how ??



Nov 23 '05 #5
hmm, I developing in c# & .net, and open the session in the 'global' class
generated when you create a new webservice project. I open in thefunction:
protected void Session_Start(Object sender, EventArgs e)
- you state that i should do it much later ? and that way can control the
licens use better. And catch exceptions thrown by the db better, and wont
have to force the app to restart.

"Christoph Schittko [MVP]" wrote:
It sounds like you are storing database connections (or objects that
hold open database connections) in the session state? If that's the case
you need to design your application to eliminate the root cause of your
problems instead of addressing the symptom by killing the worker
process.

You __have to__ follow the recommended usage for database connections,
i.e. call open as late as possible, execute your SQL and close/dispose
the connection. Otherwise you will see the problems you're reporting.

Killing the worker process will kill all sessions for all web
applications running in that instance. You can never be sure that you
are not impacting other users of other applications when you just kill
the process.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke************************@discussions.micr osoft.com]
Posted At: Tuesday, December 28, 2004 7:35 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: restart webservice
Subject: Re: restart webservice

I've just been looking around the user on my computer, ASPNET is
appearently
only used for running the aspnet_wp process, and i could set

appearently
set
som times to shorter than ever on my iss's properties.
Which i guess will end the session and close the application and

retarting
it again. ( and herby freeing licenses)

"Christoph Schittko [MVP]" wrote:
What exactly do you mean when you say restart? You always get a new
instance of your web service class for every new incoming request. Why do you want to restart the service?

You would have to restart the ASP.Net or the IIS worker process which would affect the availability of your web service and potentially other web applications on that serve.

Also you would need to run undo an account with administrator
privileges. Is that really something you want to do?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

> -----Original Message-----
> From: kenneth fleckenstein nielsen
> [mailto:ke************************@discussions.micr osoft.com]
> Posted At: Monday, December 27, 2004 4:14 AM
> Posted To: microsoft.public.dotnet.framework.webservices
> Conversation: restart webservice
> Subject: restart webservice
>
> hi guru's
> I want to restart my webservice when ever it throws an exception that > isn't
> cought. can i do that by web.config or iss or how ??


Nov 23 '05 #6
It would be nice just to restart the httpApp that the service derive from.
But it doesn't seam to have an end/exit function to call.

"Christoph Schittko [MVP]" wrote:
It sounds like you are storing database connections (or objects that
hold open database connections) in the session state? If that's the case
you need to design your application to eliminate the root cause of your
problems instead of addressing the symptom by killing the worker
process.

You __have to__ follow the recommended usage for database connections,
i.e. call open as late as possible, execute your SQL and close/dispose
the connection. Otherwise you will see the problems you're reporting.

Killing the worker process will kill all sessions for all web
applications running in that instance. You can never be sure that you
are not impacting other users of other applications when you just kill
the process.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke************************@discussions.micr osoft.com]
Posted At: Tuesday, December 28, 2004 7:35 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: restart webservice
Subject: Re: restart webservice

I've just been looking around the user on my computer, ASPNET is
appearently
only used for running the aspnet_wp process, and i could set

appearently
set
som times to shorter than ever on my iss's properties.
Which i guess will end the session and close the application and

retarting
it again. ( and herby freeing licenses)

"Christoph Schittko [MVP]" wrote:
What exactly do you mean when you say restart? You always get a new
instance of your web service class for every new incoming request. Why do you want to restart the service?

You would have to restart the ASP.Net or the IIS worker process which would affect the availability of your web service and potentially other web applications on that serve.

Also you would need to run undo an account with administrator
privileges. Is that really something you want to do?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

> -----Original Message-----
> From: kenneth fleckenstein nielsen
> [mailto:ke************************@discussions.micr osoft.com]
> Posted At: Monday, December 27, 2004 4:14 AM
> Posted To: microsoft.public.dotnet.framework.webservices
> Conversation: restart webservice
> Subject: restart webservice
>
> hi guru's
> I want to restart my webservice when ever it throws an exception that > isn't
> cought. can i do that by web.config or iss or how ??


Nov 23 '05 #7
That's not what you asked for initially ...

It's doable, by unloading the app domain that the application is running
in, but I'm not sure if the account that's doing that requires special
privileged.

Either way, you're much better off changing the design of your
application.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke************************@discussions.micr osoft.com]
Posted At: Wednesday, December 29, 2004 6:37 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: restart webservice
Subject: Re: restart webservice

It would be nice just to restart the httpApp that the service derive from. But it doesn't seam to have an end/exit function to call.

"Christoph Schittko [MVP]" wrote:
It sounds like you are storing database connections (or objects that
hold open database connections) in the session state? If that's the case you need to design your application to eliminate the root cause of your problems instead of addressing the symptom by killing the worker
process.

You __have to__ follow the recommended usage for database connections, i.e. call open as late as possible, execute your SQL and close/dispose the connection. Otherwise you will see the problems you're reporting.
Killing the worker process will kill all sessions for all web
applications running in that instance. You can never be sure that you are not impacting other users of other applications when you just kill the process.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke************************@discussions.micr osoft.com]
Posted At: Tuesday, December 28, 2004 7:35 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: restart webservice
Subject: Re: restart webservice

I've just been looking around the user on my computer, ASPNET is
appearently
only used for running the aspnet_wp process, and i could set

appearently
set
som times to shorter than ever on my iss's properties.
Which i guess will end the session and close the application and

retarting
it again. ( and herby freeing licenses)

"Christoph Schittko [MVP]" wrote:

> What exactly do you mean when you say restart? You always get a new > instance of your web service class for every new incoming
request. Why
> do you want to restart the service?
>
> You would have to restart the ASP.Net or the IIS worker process

which
> would affect the availability of your web service and
potentially other
> web applications on that serve.
>
> Also you would need to run undo an account with administrator
> privileges. Is that really something you want to do?
>
> HTH,
> Christoph Schittko
> MVP XML
> http://weblogs.asp.net/cschittko
>
> > -----Original Message-----
> > From: kenneth fleckenstein nielsen
> > [mailto:ke************************@discussions.micr osoft.com]
> > Posted At: Monday, December 27, 2004 4:14 AM
> > Posted To: microsoft.public.dotnet.framework.webservices
> > Conversation: restart webservice
> > Subject: restart webservice
> >
> > hi guru's
> > I want to restart my webservice when ever it throws an
exception that
> > isn't
> > cought. can i do that by web.config or iss or how ??
>
>



Nov 23 '05 #8
You are correct. Open the connection just when you need to execute a
database command and then close it as soon as you're done. That way you
don't tie up database connections (licenses) and ensure that database
connection can be pooled.

That should avoid your exceptions altogether (or at least rule out one
possible cause ;) ).

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke************************@discussions.micr osoft.com]
Posted At: Wednesday, December 29, 2004 2:35 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: restart webservice
Subject: Re: restart webservice

hmm, I developing in c# & .net, and open the session in the 'global' class generated when you create a new webservice project. I open in thefunction: protected void Session_Start(Object sender, EventArgs e)
- you state that i should do it much later ? and that way can control the licens use better. And catch exceptions thrown by the db better, and wont have to force the app to restart.

"Christoph Schittko [MVP]" wrote:
It sounds like you are storing database connections (or objects that
hold open database connections) in the session state? If that's the case you need to design your application to eliminate the root cause of your problems instead of addressing the symptom by killing the worker
process.

You __have to__ follow the recommended usage for database connections, i.e. call open as late as possible, execute your SQL and close/dispose the connection. Otherwise you will see the problems you're reporting.
Killing the worker process will kill all sessions for all web
applications running in that instance. You can never be sure that you are not impacting other users of other applications when you just kill the process.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke************************@discussions.micr osoft.com]
Posted At: Tuesday, December 28, 2004 7:35 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: restart webservice
Subject: Re: restart webservice

I've just been looking around the user on my computer, ASPNET is
appearently
only used for running the aspnet_wp process, and i could set

appearently
set
som times to shorter than ever on my iss's properties.
Which i guess will end the session and close the application and

retarting
it again. ( and herby freeing licenses)

"Christoph Schittko [MVP]" wrote:

> What exactly do you mean when you say restart? You always get a new > instance of your web service class for every new incoming
request. Why
> do you want to restart the service?
>
> You would have to restart the ASP.Net or the IIS worker process

which
> would affect the availability of your web service and
potentially other
> web applications on that serve.
>
> Also you would need to run undo an account with administrator
> privileges. Is that really something you want to do?
>
> HTH,
> Christoph Schittko
> MVP XML
> http://weblogs.asp.net/cschittko
>
> > -----Original Message-----
> > From: kenneth fleckenstein nielsen
> > [mailto:ke************************@discussions.micr osoft.com]
> > Posted At: Monday, December 27, 2004 4:14 AM
> > Posted To: microsoft.public.dotnet.framework.webservices
> > Conversation: restart webservice
> > Subject: restart webservice
> >
> > hi guru's
> > I want to restart my webservice when ever it throws an
exception that
> > isn't
> > cought. can i do that by web.config or iss or how ??
>
>



Nov 23 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Davie | last post: by
1 post views Thread by Nalaka | last post: by
3 posts views Thread by John A Grandy | last post: by
6 posts views Thread by Leonardo Curros | last post: by
5 posts views Thread by AliR | last post: by
4 posts views Thread by shorti | last post: by

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.