Exemple #1
0
        protected virtual void Dispose(bool finalize)
        {
            if (_isDisposed)
            {
                return;
            }

            _isDisposed = true;
            if (_closeStreamOnDispose)
            {
                if (_sr != null)
                {
                    _sr.Dispose();
                }
                if (_parquetReader != null)
                {
                    _parquetReader.Dispose();
                }
            }

            if (!ChoETLFrxBootstrap.IsSandboxEnvironment)
            {
                System.Threading.Thread.CurrentThread.CurrentCulture = _prevCultureInfo;
            }

            _closeStreamOnDispose = false;

            if (!finalize)
            {
                GC.SuppressFinalize(this);
            }
        }
Exemple #2
0
        public override void Dispose()
        {
            if (dataFileReader != null)
            {
                dataFileReader.Dispose();
                dataFileReader = null;
            }

            base.Dispose();
        }
        public void Dispose()
        {
            //NOTE: We MUST dispose of of items in this order to eliminate issues with Locks and risk of leaving
            //      the stream (e.g. file) with a current lock, etc.
            _parquetReader?.Dispose();
            _blobStream?.Dispose();

            if (_tempFileInfo != null)
            {
                //NOTE: This should be safe per MS Docs: "If the file to be deleted does not exist, no exception is thrown."
                //  as long as we ensure the parameter is not null and is a full file path and not a folder path, etc.
                _tempFileInfo.Delete();
            }
        }
Exemple #4
0
 /// <summary>
 ///		Cierra el archivo
 /// </summary>
 public void Close()
 {
     // Cierra el lector de parquet
     if (_parquetReader != null)
     {
         _parquetReader.Dispose();
         _parquetReader = null;
     }
     // Cierra el stream del archivo
     if (_fileReader != null)
     {
         _fileReader.Close();
         _fileReader = null;
     }
     // Indica que está cerrado
     IsClosed = true;
 }