@@ -35,7 +35,6 @@ internal sealed class SqlConnectionX : DbConnection, ICloneable
3535 private SqlConnector ? _internalConnection ;
3636
3737 private bool _disposed ;
38- private int _closeCount ;
3938
4039 //TODO: Investigate if we can just use dataSource.ConnectionString. Do this when this class can resolve its own data source.
4140 private string _connectionString = string . Empty ;
@@ -337,53 +336,6 @@ protected override DbCommand CreateDbCommand()
337336
338337 #region internal helpers
339338
340- // If wrapCloseInAction is defined, then the action it defines will be run with the connection close action passed in as a parameter
341- // The close action also supports being run asynchronously
342- internal void OnError ( SqlException exception , bool breakConnection , Action < Action > wrapCloseInAction )
343- {
344- Debug . Assert ( exception != null && exception . Errors . Count != 0 , "SqlConnection: OnError called with null or empty exception!" ) ;
345-
346- if ( breakConnection && ( ConnectionState . Open == State ) )
347- {
348- if ( wrapCloseInAction != null )
349- {
350- int capturedCloseCount = _closeCount ;
351-
352- Action closeAction = ( ) =>
353- {
354- if ( capturedCloseCount == _closeCount )
355- {
356- Close ( ) ;
357- }
358- } ;
359-
360- wrapCloseInAction ( closeAction ) ;
361- }
362- else
363- {
364- Close ( ) ;
365- }
366- }
367-
368- if ( exception . Class >= TdsEnums . MIN_ERROR_CLASS )
369- {
370- // It is an error, and should be thrown. Class of TdsEnums.MIN_ERROR_CLASS or above is an error,
371- // below TdsEnums.MIN_ERROR_CLASS denotes an info message.
372- throw exception ;
373- }
374- else
375- {
376- // If it is a class < TdsEnums.MIN_ERROR_CLASS, it is a warning collection - so pass to handler
377- this . OnInfoMessage ( new SqlInfoMessageEventArgs ( exception ) ) ;
378- }
379- }
380-
381- internal void OnInfoMessage ( SqlInfoMessageEventArgs imevent )
382- {
383- bool notified ;
384- OnInfoMessage ( imevent , out notified ) ;
385- }
386-
387339 internal void OnInfoMessage ( SqlInfoMessageEventArgs imevent , out bool notified )
388340 {
389341 // TODO review event source traces later
0 commit comments