Ejemplo n.º 1
0
        public override bool Exists()
        {
            var retryCount = 0;

            while (true)
            {
                try
                {
                    _connection.Open();
                    _connection.Close();
                    return(true);
                }
                catch (SqlException e)
                {
                    if (IsDoesNotExist(e))
                    {
                        return(false);
                    }

                    if (!RetryOnNoProcessOnEndOfPipe(e, ref retryCount))
                    {
                        throw;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private bool Exists(bool retryOnNotExists)
        {
            var retryCount = 0;

            while (true)
            {
                try
                {
                    _connection.Open();
                    _connection.Close();
                    return(true);
                }
                catch (SqlException e)
                {
                    if (!retryOnNotExists && IsDoesNotExist(e))
                    {
                        return(false);
                    }

                    if (!RetryOnExistsFailure(e, ref retryCount))
                    {
                        throw;
                    }
                }
            }
        }