Пример #1
0
        private static void DataConnectionFailureRetry(RetryState retryState)
        {
            Logger.Write(LogLevel.Normal, string.Format(CultureInfo.InvariantCulture,
                                                        "Connection retry number {0}. Delaying {1} ms before retry. Exception: {2}",
                                                        retryState.RetryCount,
                                                        retryState.Delay.TotalMilliseconds.ToString(CultureInfo.InvariantCulture),
                                                        retryState.LastError.ToString()));

            RetryPolicyUtils.RaiseAmbientRetryMessage(retryState, SqlSchemaModelErrorCodes.ServiceActions.ConnectionRetry);
        }
Пример #2
0
        public static void CommandFailureRetry(RetryState retryState, string commandKeyword)
        {
            Logger.Write(TraceEventType.Information, string.Format(
                             CultureInfo.InvariantCulture,
                             "{0} retry number {1}. Delaying {2} ms before retry. Exception: {3}",
                             commandKeyword,
                             retryState.RetryCount,
                             retryState.Delay.TotalMilliseconds.ToString(CultureInfo.InvariantCulture),
                             retryState.LastError.ToString()));

            RetryPolicyUtils.RaiseAmbientRetryMessage(retryState, SqlSchemaModelErrorCodes.ServiceActions.CommandRetry);
        }