Handling connection failures to a SQL Database