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_ERR OR.
>From there I send myself an error email, and redirect the user to anerror page (set in the web.config files)
In my code I normally do not catch an exception since it bubbles up to
the APPLICATION_ERR OR anyway. All exceptions are handled in the
APPLICATION_ERR OR.
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_ERR OR?
Would following code make a difference?
Try
myCnn.Open()
Catch ex As Exception
response.redire ct("someErrorHa ndlingPage.aspx ")
End Try