force reload of application from asp.net

M

matt

Hi,

We have an ASP.net application that sporadically fails with a strange
problem regarding the Max number of pooled connections being reached for the
database. I am currently in the process of tracking down the root cause of
this problem, although this is proving very difficult, I am as sure as I can
be (99.99%) that all my connections are closed as I have extensively
debugged this and now have all db connections managed internally to ensure
there are no connections which are not closed and thus cause this problem.
This problem has only occurred since we moved to a new dedicated server for
this application, although maybe it has only been highlighted now. Also
strange is that the requests that seem to occur at the same time as this
error are generally using the IP address of our site (which is not setup to
serve pages in our system, although will produce an asp.net generated
message), not for the domain name which we would expect all valid requests
to come in on. Any ideas on this appreciated, but my main question is.....

The problem I have currently is that when this error occurs it means no
connections to the database can be made, and as such no pages can be served,
all content is database generated. When the error occurs, we have
notifications setup so that we can restart the application, usually just
resaving web.config. What I would like to be able to until I can actually
trace the real cause of the problem, is be able to restart the asp.net
application when this error is detected. I have tried using
application.Dispose() which doesn't do what I am looking for. At the moment
the only approach I can see is "touching" the web.config file from my
asp.net application, which should ensure the application reloads, however
this seems a rather ugly way of achieving the result I am looking for.

Any help much appreciated.

Thanks,

Matt
 
S

Steve Drake

I think doing the touche is a work around until you track down your
connection code that is keeping the connection open.

Are you using using? eg

using (SqlConnection connection = new SqlConnection())
{
// DO STUFF
}

I adopted some code that had this problem, I just did a search for all new
SqlConnection() and wrapped them with a using.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top