@@ -620,7 +620,7 @@ private bool IsShiloh
620
620
}
621
621
}
622
622
623
- private static bool IsRetryEnabled => LocalAppContextSwitches . IsRetryEnabled ;
623
+ private bool IsRetriable => SqlConfigurableRetryFactory . IsRetriable ( RetryLogicProvider ) ;
624
624
625
625
/// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlCommand.xml' path='docs/members[@name="SqlCommand"]/RetryLogicProvider/*' />
626
626
[
@@ -1382,7 +1382,7 @@ public override object ExecuteScalar()
1382
1382
statistics = SqlStatistics . StartTimer ( Statistics ) ;
1383
1383
WriteBeginExecuteEvent ( ) ;
1384
1384
SqlDataReader ds ;
1385
- ds = IsRetryEnabled ?
1385
+ ds = IsRetriable ?
1386
1386
RunExecuteReaderWithRetry ( 0 , RunBehavior . ReturnImmediately , true , ADP . ExecuteScalar ) :
1387
1387
RunExecuteReader ( 0 , RunBehavior . ReturnImmediately , true , ADP . ExecuteScalar ) ;
1388
1388
object result = CompleteExecuteScalar ( ds , false ) ;
@@ -1462,7 +1462,7 @@ public override int ExecuteNonQuery()
1462
1462
statistics = SqlStatistics . StartTimer ( Statistics ) ;
1463
1463
WriteBeginExecuteEvent ( ) ;
1464
1464
bool usedCache ;
1465
- if ( IsRetryEnabled )
1465
+ if ( IsRetriable )
1466
1466
{
1467
1467
InternalExecuteNonQueryWithRetry ( ADP . ExecuteNonQuery , sendToPipe : false , CommandTimeout , out usedCache , asyncWrite : false , inRetry : false ) ;
1468
1468
}
@@ -2098,7 +2098,7 @@ public XmlReader ExecuteXmlReader()
2098
2098
2099
2099
// use the reader to consume metadata
2100
2100
SqlDataReader ds ;
2101
- ds = IsRetryEnabled ?
2101
+ ds = IsRetriable ?
2102
2102
RunExecuteReaderWithRetry ( CommandBehavior . SequentialAccess , RunBehavior . ReturnImmediately , true , ADP . ExecuteXmlReader ) :
2103
2103
RunExecuteReader ( CommandBehavior . SequentialAccess , RunBehavior . ReturnImmediately , true , ADP . ExecuteXmlReader ) ;
2104
2104
XmlReader result = CompleteXmlReader ( ds ) ;
@@ -2426,7 +2426,7 @@ private SqlDataReader ExecuteReaderWithRetry(CommandBehavior behavior, string me
2426
2426
try
2427
2427
{
2428
2428
statistics = SqlStatistics . StartTimer ( Statistics ) ;
2429
- return IsRetryEnabled ?
2429
+ return IsRetriable ?
2430
2430
ExecuteReaderWithRetry ( CommandBehavior . Default , ADP . ExecuteReader ) :
2431
2431
ExecuteReader ( CommandBehavior . Default , ADP . ExecuteReader ) ;
2432
2432
}
@@ -2444,7 +2444,7 @@ private SqlDataReader ExecuteReaderWithRetry(CommandBehavior behavior, string me
2444
2444
{
2445
2445
SqlClientEventSource . Log . TryCorrelationTraceEvent ( "<sc.SqlCommand.ExecuteReader|API|Correlation> ObjectID {0}, behavior={1}, ActivityID {2}" , ObjectID , ( int ) behavior , ActivityCorrelator . Current ) ;
2446
2446
2447
- return IsRetryEnabled ?
2447
+ return IsRetriable ?
2448
2448
ExecuteReaderWithRetry ( behavior , ADP . ExecuteReader ) :
2449
2449
ExecuteReader ( behavior , ADP . ExecuteReader ) ;
2450
2450
}
@@ -2960,7 +2960,7 @@ private Task<int> InternalExecuteNonQueryWithRetryAsync(CancellationToken cancel
2960
2960
2961
2961
/// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlCommand.xml' path='docs/members[@name="SqlCommand"]/ExecuteNonQueryAsync[@name="CancellationToken"]/*'/>
2962
2962
public override Task < int > ExecuteNonQueryAsync ( CancellationToken cancellationToken )
2963
- => IsRetryEnabled ?
2963
+ => IsRetriable ?
2964
2964
InternalExecuteNonQueryWithRetryAsync ( cancellationToken ) :
2965
2965
InternalExecuteNonQueryAsync ( cancellationToken ) ;
2966
2966
@@ -3039,25 +3039,25 @@ private Task<SqlDataReader> InternalExecuteReaderWithRetryAsync(CommandBehavior
3039
3039
3040
3040
/// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlCommand.xml' path='docs/members[@name="SqlCommand"]/ExecuteReaderAsync[@name="default"]/*'/>
3041
3041
new public Task < SqlDataReader > ExecuteReaderAsync ( )
3042
- => IsRetryEnabled ?
3042
+ => IsRetriable ?
3043
3043
InternalExecuteReaderWithRetryAsync ( CommandBehavior . Default , CancellationToken . None ) :
3044
3044
InternalExecuteReaderAsync ( CommandBehavior . Default , CancellationToken . None ) ;
3045
3045
3046
3046
/// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlCommand.xml' path='docs/members[@name="SqlCommand"]/ExecuteReaderAsync[@name="CommandBehavior"]/*'/>
3047
3047
new public Task < SqlDataReader > ExecuteReaderAsync ( CommandBehavior behavior )
3048
- => IsRetryEnabled ?
3048
+ => IsRetriable ?
3049
3049
InternalExecuteReaderWithRetryAsync ( behavior , CancellationToken . None ) :
3050
3050
InternalExecuteReaderAsync ( behavior , CancellationToken . None ) ;
3051
3051
3052
3052
/// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlCommand.xml' path='docs/members[@name="SqlCommand"]/ExecuteReaderAsync[@name="CancellationToken"]/*'/>
3053
3053
new public Task < SqlDataReader > ExecuteReaderAsync ( CancellationToken cancellationToken )
3054
- => IsRetryEnabled ?
3054
+ => IsRetriable ?
3055
3055
InternalExecuteReaderWithRetryAsync ( CommandBehavior . Default , cancellationToken ) :
3056
3056
InternalExecuteReaderAsync ( CommandBehavior . Default , cancellationToken ) ;
3057
3057
3058
3058
/// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlCommand.xml' path='docs/members[@name="SqlCommand"]/ExecuteReaderAsync[@name="commandBehaviorAndCancellationToken"]/*'/>
3059
3059
new public Task < SqlDataReader > ExecuteReaderAsync ( CommandBehavior behavior , CancellationToken cancellationToken )
3060
- => IsRetryEnabled ?
3060
+ => IsRetriable ?
3061
3061
InternalExecuteReaderWithRetryAsync ( behavior , cancellationToken ) :
3062
3062
InternalExecuteReaderAsync ( behavior , cancellationToken ) ;
3063
3063
@@ -3203,7 +3203,7 @@ private Task<XmlReader> InternalExecuteXmlReaderWithRetryAsync(CancellationToken
3203
3203
3204
3204
/// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlCommand.xml' path='docs/members[@name="SqlCommand"]/ExecuteXmlReaderAsync[@name="CancellationToken"]/*'/>
3205
3205
public Task < XmlReader > ExecuteXmlReaderAsync ( CancellationToken cancellationToken )
3206
- => IsRetryEnabled ?
3206
+ => IsRetriable ?
3207
3207
InternalExecuteXmlReaderWithRetryAsync ( cancellationToken ) :
3208
3208
InternalExecuteXmlReaderAsync ( cancellationToken ) ;
3209
3209
0 commit comments