private void InitRetryPolicy()
 {
     // Get an instance of the RetryManager class.
     _retryManager    = _retryManager ?? RetryPolicyFactory.CreateDefault();
     _connRetryPolicy = _retryManager.GetDefaultSqlConnectionRetryPolicy();
     _cmdRetryPolicy  = _retryManager.GetDefaultSqlCommandRetryPolicy();
 }
示例#2
0
        public void Initialize()
        {
            connectionString = TestSqlSupport.SqlDatabaseConnectionString;
            RetryPolicyFactory.CreateDefault();
            connection = new ReliableSqlConnection(connectionString);

            connection.ConnectionRetryPolicy.Retrying += (sender, args) =>
                                                         Trace.WriteLine(string.Format("[Connection Retry] Current Retry Count: {0}, Last Exception: {0}, Delay (ms): {0}", args.CurrentRetryCount, args.LastException.Message, args.Delay.TotalMilliseconds));

            connection.CommandRetryPolicy.Retrying += (sender, args) =>
                                                      Trace.WriteLine(string.Format("[Command Retry] Current Retry Count: {0}, Last Exception: {0}, Delay (ms): {0}", args.CurrentRetryCount, args.LastException.Message, args.Delay.TotalMilliseconds));
        }
示例#3
0
 public void Setup()
 {
     RetryPolicyFactory.CreateDefault();
 }
 public void Initialize()
 {
     this.connectionString = TestSqlSupport.SqlDatabaseConnectionString;
     RetryPolicyFactory.CreateDefault();
 }
示例#5
0
 public void Setup()
 {
     connectionString = TestSqlSupport.SqlDatabaseConnectionString;
     RetryPolicyFactory.CreateDefault();
 }