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.
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
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.
error page (set in the web.config files)From there I send myself an error email, and redirect the user to an
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