Attempts three connections to an unreachable database before raising an error.