/// <summary>
        /// Releases unmanaged and - optionally - managed resources.
        /// </summary>
        /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
        protected virtual void Dispose(bool disposing)
        {
            if (!this._disposed)
            {
                if (disposing)
                {
                    try
                    {
                        Flush();

                        //Task.Factory.StartNew(() =>
                        //{
                        //    var configService = ServiceLocator.Current.GetInstance<IConfigurationService>();
                        //    var dbCreator = ServiceLocator.Current.GetInstance<IDatabaseCreator>(CreatorNames.Sql);
                        //    dbCreator.TruncateDbLogFile(configService.ConnectionSettings.ConnectionString);
                        //}, TaskCreationOptions.LongRunning);
                    }
                    finally
                    {
                        try
                        {
                            if (CurrentTargetTable != null)
                            {
                                CurrentTargetTable.Dispose();
                                CurrentTargetTable = null;
                            }
                        }
                        finally
                        {
                            if (TargetTableSource != null)
                            {
                                TargetTableSource.Dispose();
                                TargetTableSource = null;
                            }
                        }
                    }
                }
                _disposed = true;
            }
        }