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
[quoted text clipped - 40 lines]
> > > isn't
> > > cought. can i do that by web.config or iss or how ??
kenneth fleckenstein nielsen - 29 Dec 2004 08:35 GMT
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.
> It sounds like you are storing database connections (or objects that
> hold open database connections) in the session state? If that's the case
[quoted text clipped - 66 lines]
> > > > isn't
> > > > cought. can i do that by web.config or iss or how ??
Christoph Schittko [MVP] - 29 Dec 2004 17:44 GMT
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
[quoted text clipped - 81 lines]
> > > > > isn't
> > > > > cought. can i do that by web.config or iss or how ??
kenneth fleckenstein nielsen - 29 Dec 2004 12:37 GMT
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.
> It sounds like you are storing database connections (or objects that
> hold open database connections) in the session state? If that's the case
[quoted text clipped - 66 lines]
> > > > isn't
> > > > cought. can i do that by web.config or iss or how ??
Christoph Schittko [MVP] - 29 Dec 2004 17:38 GMT
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
[quoted text clipped - 77 lines]
> > > > > isn't
> > > > > cought. can i do that by web.config or iss or how ??