public void Dispose() { lock (_stopLocker) { _disposing = true; } if (_notificationState != NotificationState.Disabled) { try { _oracleDependencyManager.RemoveRegistration(ConnectionString); } catch (Exception ex) { Trace.TraceError("Failed to stop oracle dependency: {0}", ex); } } if (Interlocked.Read(ref _notificationState) == NotificationState.ProcessingUpdates) { _stopHandle.Wait(); } _stopHandle.Dispose(); }