by Wil van Antwerpen
A hickup in your SQL Server can take your webapp down for a long time. Here's a package I wrote for a customer to take care of this particular example.
|Size: 8 KB
||Wil van Antwerpen
WebApp SQL Errorhandler
One of the fun things with webapps is when they don't work.
A failing webapp might take your website down, not for just one user, but for all of them.
Especially if you happen to restart your SQL server while a user queries a page. Then that particular process is stuck until it gets killed by the webapp service (if it gets killed)
Here is an extended webapp error handler that helps you with this particular "process gets stuck" problem.
With this code, we can take the SQL server down, have a customer request a page during the down time and still have your webapp server completely recover within 2 minutes (assuming the SQL server connection is back up) It could even recover between a faulty page (server down) and the next one, although serving the first page is slower then as it has to set up the connection to the database once more.
One thing you'll see in the new webapp error handler is that we added process Ids so that you can see in the webapp errorlog which process hung itself up... (Can you see the fun here where you cannot remotely debug such an event)
Simple code, once you got it figured out.
With special thanks to McFarland Cascade for allowing me to share this code.