Hi All,

I am stuck up in a strange situation. I have a window service
responsible for some background database process.

Is there any possible solution to close open database connection when
server is re-booted ? Please see the source snippet I used.

protected override void OnShutdown()
{
//close database connection if any
ClassDatabase.CloseDBConn();

//Log to verify if Shutdown is called.
string strLog = "Service Shutdown.\t" + DateTime.Now.ToString();
CLogHelper.Log(strLog);
}

Is there any kind of limitation in OnShutdown Function? Any help would
be highly appreciated.

Regards
- Amit Gupta