コード例 #1
0
        private DbProviderFactory GetDbProviderFactory(SqlEtlConfiguration configuration)
        {
            DbProviderFactory providerFactory;

            try
            {
                providerFactory = DbProviderFactories.GetFactory(configuration.GetFactoryName());
            }
            catch (Exception e)
            {
                var message = $"Could not find provider factory {configuration.GetFactoryName()} to replicate to sql for {configuration.Name}, ignoring.";

                if (_logger.IsInfoEnabled)
                {
                    _logger.Info(message, e);
                }

                _database.NotificationCenter.Add(AlertRaised.Create(
                                                     _database.Name,
                                                     SqlEtl.SqlEtlTag,
                                                     message,
                                                     AlertType.SqlEtl_ProviderError,
                                                     NotificationSeverity.Error,
                                                     details: new ExceptionDetails(e)));

                throw;
            }
            return(providerFactory);
        }
コード例 #2
0
 public RelationalDatabaseWriterSimulator(SqlEtlConfiguration configuration)
     : base(configuration.GetFactoryName())
 {
     _configuration   = configuration;
     _providerFactory = DbProviderFactories.GetFactory(configuration.GetFactoryName());
     _commandBuilder  = _providerFactory.InitializeCommandBuilder();
 }