1 write to _activeConnection
System.Data (1)
fx\src\data\System\Data\SqlClient\SqlCommand.cs (1)
512
_activeConnection
= value; //
185 references to _activeConnection
System.Data (185)
fx\src\data\System\Data\SqlClient\SqlCommand.cs (185)
156
|| (_columnEncryptionSetting == SqlCommandColumnEncryptionSetting.UseConnectionSetting &&
_activeConnection
.IsColumnEncryptionSettingEnabled))
157
&&
_activeConnection
.Parser != null
158
&&
_activeConnection
.Parser.IsColumnEncryptionSupported;
163
get { return !string.IsNullOrWhiteSpace(
_activeConnection
.EnclaveAttestationUrl) && IsColumnEncryptionEnabled; }
450
return
_activeConnection
;
454
if (
_activeConnection
!= value &&
_activeConnection
!= null) { // If new value...
471
if (
_activeConnection
!= value &&
_activeConnection
!= null) {
490
_activeConnection
.InnerConnection.DoomThisConnection();
494
_activeConnection
.InnerConnection.DoomThisConnection();
498
_activeConnection
.InnerConnection.DoomThisConnection();
529
return (SqlInternalConnectionSmi)
_activeConnection
.InnerConnection;
535
return (SqlInternalConnectionTds)
_activeConnection
.InnerConnection;
541
Debug.Assert(
_activeConnection
!= null, "The active connection is null!");
542
if (
_activeConnection
== null)
544
return
_activeConnection
.IsShiloh;
582
if (null !=
_activeConnection
) {
583
if (
_activeConnection
.StatisticsEnabled) {
584
return
_activeConnection
.Statistics;
606
if (_transaction != value &&
_activeConnection
!= null) { // If new value...
834
if (null !=
_activeConnection
&&
_activeConnection
.IsContextConnection) {
868
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(
_activeConnection
);
899
_activeConnection
.Abort(e);
904
_activeConnection
.Abort(e);
909
_activeConnection
.Abort(e);
941
Debug.Assert(
_activeConnection
!= null, "must have an open connection to Prepare");
944
Debug.Assert(_stateObj.Parser ==
_activeConnection
.Parser, "stateobject parser not same as connection parser");
950
_preparedConnectionCloseCount =
_activeConnection
.CloseCount;
951
_preparedConnectionReconnectCount =
_activeConnection
.ReconnectCount;
961
if (
_activeConnection
.IsContextConnection) {
966
Debug.Assert(
_activeConnection
!= null, "must have an open connection to UnPrepare");
980
if ((
_activeConnection
.CloseCount != _preparedConnectionCloseCount) || (
_activeConnection
.ReconnectCount != _preparedConnectionReconnectCount)) {
1019
if (null ==
_activeConnection
) {
1022
SqlInternalConnectionTds connection = (
_activeConnection
.InnerConnection as SqlInternalConnectionTds);
1032
if (connection != (
_activeConnection
.InnerConnection as SqlInternalConnectionTds)) { // make sure the connection held on the active connection is what we have stored in our temp connection variable, if not between getting "connection" and takeing the lock, the connection has been closed
1053
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(
_activeConnection
);
1082
_activeConnection
.Abort(e);
1086
_activeConnection
.Abort(e);
1090
_activeConnection
.Abort(e);
1326
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(
_activeConnection
);
1328
cachedAsyncState.SetActiveConnectionAndResult(completion, ADP.EndExecuteNonQuery,
_activeConnection
);
1338
_activeConnection
.Abort(e);
1342
_activeConnection
.Abort(e);
1346
_activeConnection
.Abort(e);
1383
if (
_activeConnection
.State != ConnectionState.Open) {
1397
if ((
_activeConnection
.State != ConnectionState.Open) || (!cachedAsyncState.IsActiveConnectionValid(
_activeConnection
))) {
1419
_activeConnection
.GetOpenTdsConnection().DecrementAsyncCount();
1515
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(
_activeConnection
);
1586
_activeConnection
.Abort(e);
1590
_activeConnection
.Abort(e);
1594
_activeConnection
.Abort(e);
1619
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(
_activeConnection
);
1630
if (
_activeConnection
.IsContextConnection ) {
1678
_activeConnection
.Abort(e);
1682
_activeConnection
.Abort(e);
1686
_activeConnection
.Abort(e);
1819
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(
_activeConnection
);
1821
cachedAsyncState.SetActiveConnectionAndResult(completion, ADP.EndExecuteXmlReader,
_activeConnection
);
1831
_activeConnection
.Abort(e);
1836
_activeConnection
.Abort(e);
1841
_activeConnection
.Abort(e);
2028
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(
_activeConnection
);
2045
_activeConnection
.Abort(e);
2049
_activeConnection
.Abort(e);
2053
_activeConnection
.Abort(e);
2257
_activeConnection
.GetOpenTdsConnection().DecrementAsyncCount();
2266
EnclaveDelegate.Instance.InvalidateEnclaveSession(this.
_activeConnection
.Parser.EnclaveType, this.
_activeConnection
.DataSource, this.
_activeConnection
.EnclaveAttestationUrl, this.enclavePackage.EnclaveSession);
2316
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(
_activeConnection
);
2318
cachedAsyncState.SetActiveConnectionAndResult(completion, ADP.EndExecuteReader,
_activeConnection
);
2328
_activeConnection
.Abort(e);
2333
_activeConnection
.Abort(e);
2338
_activeConnection
.Abort(e);
2379
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(
_activeConnection
);
2391
_activeConnection
.Abort(e);
2395
_activeConnection
.Abort(e);
2399
_activeConnection
.Abort(e);
2886
Debug.Assert(this.
_activeConnection
.IsYukonOrNewer,"Invalid datatype token received from pre-yukon server");
2905
Debug.Assert(this.
_activeConnection
.IsKatmaiOrNewer,"Invalid datatype token received from pre-katmai server");
2991
if (
_activeConnection
.IsYukonOrNewer) { // Only supported for Yukon...
3025
SqlInternalConnectionTds internalConnection =
_activeConnection
.InnerConnection as SqlInternalConnectionTds;
3033
Notification.Options = SqlDependency.GetDefaultComposedOptions(
_activeConnection
.DataSource,
3035
identityUserName,
_activeConnection
.Database);
3043
_sqlDep.AddToServerList(
_activeConnection
.DataSource);
3063
Task reconnectTask =
_activeConnection
.ValidateAndReconnect(null, timeout);
3069
_activeConnection
.RegisterWaitingForReconnect(completion.Task);
3087
}, connectionToAbort:
_activeConnection
);
3097
_activeConnection
.AddWeakReference(this, SqlReferenceCollection.CommandTag);
3115
_activeConnection
.GetOpenTdsConnection(methodName).IncrementAsyncCount();
3256
SqlInternalConnectionTds internalConnectionTds =
_activeConnection
.GetOpenTdsConnection();
3289
Debug.Assert(
_activeConnection
!= null, "_activeConnection should not be null in PrepareForTransparentEncryption.");
3290
Debug.Assert(
_activeConnection
.Parser != null, "_activeConnection.Parser should not be null in PrepareForTransparentEncryption.");
3291
Debug.Assert(
_activeConnection
.Parser.IsColumnEncryptionSupported,
3294
|| (_columnEncryptionSetting == SqlCommandColumnEncryptionSetting.UseConnectionSetting &&
_activeConnection
.IsColumnEncryptionSettingEnabled),
3329
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(
_activeConnection
);
3387
SqlInternalConnectionTds internalConnectionTds =
_activeConnection
.GetOpenTdsConnection();
3458
SqlInternalConnectionTds internalConnectionTds =
_activeConnection
.GetOpenTdsConnection();
3534
_activeConnection
.Abort(e);
3538
_activeConnection
.Abort(e);
3542
_activeConnection
.Abort(e);
3582
string enclaveType = this.
_activeConnection
.Parser.EnclaveType;
3583
string dataSource = this.
_activeConnection
.DataSource;
3584
string enclaveAttestationUrl = this.
_activeConnection
.EnclaveAttestationUrl;
3776
Debug.Assert(
_activeConnection
!= null, "_activeConnection should not be null at this time, in PrepareDescribeParameterEncryptionRequest.");
3779
if (
_activeConnection
.Parser != null) {
3780
tdsParser =
_activeConnection
.Parser;
3897
if (this.
_activeConnection
.Parser.TceVersionSupported >= TdsEnums.MIN_TCE_VERSION_WITH_ENCLAVE_SUPPORT) {
3910
throw SQL.NoAttestationUrlSpecifiedForEnclaveBasedQuerySpDescribe(this.
_activeConnection
.Parser.EnclaveType);
3922
string servername = this.
_activeConnection
.DataSource;
4013
Debug.Assert(
_activeConnection
!= null, @"_activeConnection should not be null");
4014
SqlSecurityUtility.DecryptSymmetricKey(sqlParameter.CipherMetadata, this.
_activeConnection
.DataSource);
4047
throw SQL.UnexpectedDescribeParamFormatAttestationInfo (this.
_activeConnection
.Parser.EnclaveType);
4062
string enclaveType = this.
_activeConnection
.Parser.EnclaveType;
4063
string dataSource = this.
_activeConnection
.DataSource;
4064
string enclaveAttestationUrl = this.
_activeConnection
.EnclaveAttestationUrl;
4072
throw SQL.AttestationInfoNotReturnedFromSqlServer(this.
_activeConnection
.Parser.EnclaveType, this.
_activeConnection
.EnclaveAttestationUrl);
4140
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(
_activeConnection
);
4156
if (
_activeConnection
.IsContextConnection ) {
4181
EnclaveDelegate.Instance.InvalidateEnclaveSession(this.
_activeConnection
.Parser.EnclaveType, this.
_activeConnection
.DataSource, this.
_activeConnection
.EnclaveAttestationUrl, this.enclavePackage.EnclaveSession);
4216
EnclaveDelegate.Instance.InvalidateEnclaveSession(this.
_activeConnection
.Parser.EnclaveType, this.
_activeConnection
.DataSource, this.
_activeConnection
.EnclaveAttestationUrl, this.enclavePackage.EnclaveSession);
4235
_activeConnection
.Abort(e);
4239
_activeConnection
.Abort(e);
4243
_activeConnection
.Abort(e);
4308
connectionToAbort:
_activeConnection
);
4324
if (string.IsNullOrWhiteSpace(this.
_activeConnection
.EnclaveAttestationUrl)) throw SQL.NoAttestationUrlSpecifiedForEnclaveBasedQueryGeneratingEnclavePackage(this.
_activeConnection
.Parser.EnclaveType);
4326
string enclaveType = this.
_activeConnection
.Parser.EnclaveType;
4331
this.CommandText, enclaveType, this.
_activeConnection
.DataSource,
4332
this.
_activeConnection
.EnclaveAttestationUrl);
4349
Task reconnectTask =
_activeConnection
.ValidateAndReconnect(null, timeout);
4355
_activeConnection
.RegisterWaitingForReconnect(completion.Task);
4374
}, connectionToAbort:
_activeConnection
);
4387
Debug.Assert(null !=
_activeConnection
.Parser, "TdsParser class should not be null in Command.Execute!");
4402
_activeConnection
.GetOpenTdsConnection().IncrementAsyncCount();
4409
_activeConnection
.AddWeakReference(this, SqlReferenceCollection.CommandTag);
4448
throw SQL.NullEnclavePackageForEnclaveBasedQuery(this.
_activeConnection
.Parser.EnclaveType, this.
_activeConnection
.EnclaveAttestationUrl);
4477
Debug.Assert(
_activeConnection
.IsShiloh, "Invalid attempt to call sp_prepexec on non 7.x server");
4481
_preparedConnectionCloseCount =
_activeConnection
.CloseCount;
4482
_preparedConnectionReconnectCount =
_activeConnection
.ReconnectCount;
4492
if (
_activeConnection
.IsShiloh)
4531
_activeConnection
.CheckSQLDebug();
4544
_activeConnection
.GetOpenTdsConnection(); // it will throw if connection is closed
4548
_activeConnection
.GetOpenTdsConnection().DecrementAsyncCount();
4563
SqlInternalConnectionTds innerConnectionTds = (
_activeConnection
.InnerConnection as SqlInternalConnectionTds);
4630
_activeConnection
.AddWeakReference(ds, SqlReferenceCollection.DataReaderTag);
4733
_activeConnection
.AddWeakReference(ds, SqlReferenceCollection.DataReaderTag);
4791
SqlConnection connection =
_activeConnection
;
4803
if (null ==
_activeConnection
) {
4808
SqlInternalConnectionTds tdsConnection =
_activeConnection
.InnerConnection as SqlInternalConnectionTds;
4811
if (((SqlCommandColumnEncryptionSetting.UseConnectionSetting == ColumnEncryptionSetting &&
_activeConnection
.IsColumnEncryptionSettingEnabled)
4828
else if (
_activeConnection
.State == ConnectionState.Closed) {
4831
else if (
_activeConnection
.State == ConnectionState.Broken) {
4849
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(
_activeConnection
);
4852
_activeConnection
.ValidateConnectionForExecute(method, this);
4863
_activeConnection
.Abort(e);
4868
_activeConnection
.Abort(e);
4873
_activeConnection
.Abort(e);
4884
if (
_activeConnection
.HasLocalTransactionFromAPI && (null == _transaction))
4890
if (null != _transaction &&
_activeConnection
!= _transaction.Connection)
4897
if ((Notification != null) && !
_activeConnection
.IsYukonOrNewer) {
4901
if ((async) && (
_activeConnection
.IsContextConnection)) {
4910
if (cachedAsyncState.IsActiveConnectionValid(
_activeConnection
)) {
4922
Debug.Assert (null !=
_activeConnection
, "no active connection?");
4935
parser =
_activeConnection
.Parser;
4972
bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(
_activeConnection
);
4984
_activeConnection
.Abort(e);
4989
_activeConnection
.Abort(e);
4994
_activeConnection
.Abort(e);
5172
TdsParser parser =
_activeConnection
.Parser;
5179
Debug.Assert(
_activeConnection
!= null, @"_activeConnection should not be null");
5183
byte[] unencryptedBytes = SqlSecurityUtility.DecryptWithKey(rec.value.ByteArray, rec.cipherMD,
_activeConnection
.DataSource);
5298
if (
_activeConnection
.IsKatmaiOrNewer) {
5420
TdsParser parser =
_activeConnection
.Parser;
6020
var activeConnection =
_activeConnection
;