We have written an application which runs as a Windows service. Within the service we have a timer that fires every 15 seconds and connects to a ODBC datasource (e.g. MySql, SqlServer), processes queries, and disconnects. We always assume the connection exists and use exception handling in our code when it can't be made.
When the connection to the database is sporadic (i.e. poor network connection, or simply the database is off), I have seen that our service will sometimes get turned off by Windows at arbitrary points.
So my question is: does Windows have some sort of mechanism to halt services if it detects it is continuously making failed requests and throwing exceptions? (in our case the unsuccessful attempts to connect to the database). Almost as if to say "Ok - you have been making these requests every 15 seconds and it is consuming resources; therefore I am going to shut you off!
Our service always tries to make a connection, and if it can't we have the