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