public MySqlStorage(string connectionString, MySqlStorageOptions storageOptions) { if (connectionString == null) { throw new ArgumentNullException("connectionString"); } if (storageOptions == null) { throw new ArgumentNullException("storageOptions"); } if (IsConnectionString(connectionString)) { _connectionString = connectionString; } else { throw new ArgumentException( string.Format( "Could not find connection string with name '{0}' in application config file", connectionString)); } _storageOptions = storageOptions; if (storageOptions.PrepareSchemaIfNecessary) { using (var connection = CreateAndOpenConnection()) { MySqlObjectsInstaller.Install(connection, storageOptions.TablesPrefix); } } InitializeQueueProviders(); }
public MySqlStorageConnection(MySqlStorage storage, MySqlStorageOptions storageOptions) { if (storage == null) { throw new ArgumentNullException("storage"); } _storage = storage; _storageOptions = storageOptions; }
public CountersAggregator(MySqlStorage storage, MySqlStorageOptions storageOptions) { if (storage == null) { throw new ArgumentNullException("storage"); } _storage = storage; _storageOptions = storageOptions; }
public MySqlWriteOnlyTransaction(ElasticStorage.ElasticStorage storage, MySqlStorageOptions storageOptions) { if (storage == null) { throw new ArgumentNullException("storage"); } _storage = storage; _storageOptions = storageOptions; }
public MySqlStorage(string nameOrConnectionString, MySqlStorageOptions options) { _connectionString = GetConnectionStringFrom(nameOrConnectionString); _options = options; Setup setup = new Setup(_connectionString); setup.EnsureDatabase(); InitializeQueueProviders(); }
internal MySqlStorage(MySqlConnection existingConnection) { if (existingConnection == null) { throw new ArgumentNullException("existingConnection"); } _existingConnection = existingConnection; _options = new MySqlStorageOptions(); InitializeQueueProviders(); }
public MySqlStorage(MySqlConnection existingConnection, MySqlStorageOptions storageOptions) { if (existingConnection == null) { throw new ArgumentNullException("existingConnection"); } _existingConnection = existingConnection; _storageOptions = storageOptions; InitializeQueueProviders(); }
public MySqlDistributedLock( IDbConnection connection, string resource, TimeSpan timeout, MySqlStorageOptions storageOptions, CancellationToken cancellationToken) { Logger.TraceFormat("MySqlDistributedLock resource={0}, timeout={1}", resource, timeout); _storageOptions = storageOptions; _resource = resource; _timeout = timeout; _connection = connection; _cancellationToken = cancellationToken; _start = DateTime.UtcNow; }
public ExpirationManager(ElasticStorage.ElasticStorage storage, MySqlStorageOptions storageOptions) { _storage = storage ?? throw new ArgumentNullException("storage"); _storageOptions = storageOptions ?? throw new ArgumentNullException(nameof(storageOptions)); _processedTables = new[] { $"{storageOptions.TablesPrefix}AggregatedCounter", $"{storageOptions.TablesPrefix}Job", $"{storageOptions.TablesPrefix}List", $"{storageOptions.TablesPrefix}Set", $"{storageOptions.TablesPrefix}Hash", }; }
public MySqlStorage(string nameOrConnectionString, MySqlStorageOptions options) { if (nameOrConnectionString == null) { throw new ArgumentNullException("nameOrConnectionString"); } if (options == null) { throw new ArgumentNullException("options"); } if (IsConnectionString(nameOrConnectionString)) { _connectionString = nameOrConnectionString; } else if (IsConnectionStringInConfiguration(nameOrConnectionString)) { _connectionString = ConfigurationManager.ConnectionStrings[nameOrConnectionString].ConnectionString; } else { throw new ArgumentException( string.Format( "Could not find connection string with name '{0}' in application config file", nameOrConnectionString)); } /*if (!_connectionString.Contains("Use Affected Rows")) * { * _connectionString = _connectionString.TrimEnd(' ', ';') + ";Use Affected Rows=true"; * }*/ _options = options; if (options.PrepareSchemaIfNecessary) { using (var connection = CreateAndOpenConnection()) { MySqlObjectsInstaller.Install(connection); } } InitializeQueueProviders(); }
public MySqlStorage(string nameOrConnectionString, MySqlStorageOptions options) { if (nameOrConnectionString == null) { throw new ArgumentNullException("nameOrConnectionString"); } if (options == null) { throw new ArgumentNullException("options"); } if (IsConnectionString(nameOrConnectionString)) { _connectionString = ApplyAllowUserVariablesProperty(nameOrConnectionString); } else if (IsConnectionStringInConfiguration(nameOrConnectionString)) { _connectionString = ApplyAllowUserVariablesProperty( ConfigurationManager.ConnectionStrings[nameOrConnectionString].ConnectionString); } else { throw new ArgumentException( string.Format( "Could not find connection string with name '{0}' in application config file", nameOrConnectionString)); } _options = options; if (options.PrepareSchemaIfNecessary) { using (var connection = CreateAndOpenConnection()) { MySqlObjectsInstaller.Install(connection); } } InitializeQueueProviders(); }
public static IGlobalConfiguration <MySqlStorage> UseMySqlStorage( [NotNull] this IGlobalConfiguration configuration, [NotNull] string nameOrConnectionString, [NotNull] MySqlStorageOptions options) { if (configuration == null) { throw new ArgumentNullException("configuration"); } if (nameOrConnectionString == null) { throw new ArgumentNullException("nameOrConnectionString"); } if (options == null) { throw new ArgumentNullException("options"); } var storage = new MySqlStorage(nameOrConnectionString, options); return(configuration.UseStorage(storage)); }
public MySqlStorage(string nameOrConnectionString, MySqlStorageOptions options) { if (nameOrConnectionString == null) { throw new ArgumentNullException("nameOrConnectionString"); } if (options == null) { throw new ArgumentNullException("options"); } _connectionString = ApplyAllowUserVariablesProperty(nameOrConnectionString); _options = options; if (options.PrepareSchemaIfNecessary) { using (var connection = CreateAndOpenConnection()) { MySqlObjectsInstaller.Install(connection); } } InitializeQueueProviders(); }
public MySqlDistributedLock(IDbConnection connection, string resource, TimeSpan timeout, MySqlStorageOptions storageOptions) : this(connection, resource, timeout, storageOptions, new CancellationToken()) { }
public MySqlDistributedLock(MySqlStorage storage, string resource, TimeSpan timeout, MySqlStorageOptions storageOptions) : this(storage.CreateAndOpenConnection(), resource, timeout, storageOptions) { _storage = storage; }