Service Unavailable after Database restart caused by exceptions?

M

MichiMichi

My services shows once a while the infamous error "Service
Unavailable" (http 503 error). This error happens only if my asp.net
application encounters a problem with the SQL Server. In my case it
occured when my DB logs were full or the server administrator on the
shared server environment restarted the DB.

After my ISP restarts the DB, my services are still unavailable, which
means I have to connect myself to the webhosting panel and restart the
service myself. That is very troublesome especially if it happens
during the weekend with no staff in the office to check the service.

My ISP told my that my exception handling might cause the problem. The
service likely kills itself when a few hundred exeption occured.

In my code I normally catch every exception in the APPLICATION_ERROR.
From there I send myself an error email, and redirect the user to an
error page (set in the web.config files)

In my code I normally do not catch an exception since it bubbles up to
the APPLICATION_ERROR anyway. All exceptions are handled in the
APPLICATION_ERROR.


Questions )

Do I need to enclose my db execution statements in a TRY CATCH block?
Will this prevent the "Service Unavailable" Error.

Is there a difference when I catch an exception with a TRY CATCH block
or let it "naturally" bubble up to the APPLICATION_ERROR?

Would following code make a difference?

Try
myCnn.Open()
Catch ex As Exception
response.redirect("someErrorHandlingPage.aspx")
End Try
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top