/// <summary> /// Creates a <see cref="DataTable"/> based on the required insert/update command parameters. /// </summary> private static DbBatchOperation CreateBuffer(IStoreEventSettings settings, IEventStoreDialect dialect) { using (var command = dialect.CreateCommand(dialect.MarkDispatched)) { command.Parameters.Add(dialect.CreateIdParameter(default(Int64))); return(new DbBatchOperation(dialect, command, settings.BatchSize, settings.FlushInterval)); } }
/// <summary> /// Creates a <see cref="DataTable"/> based on the required insert/update command parameters. /// </summary> private static DbBatchOperation CreateBuffer(IStoreEventSettings settings, IEventStoreDialect dialect) { using (var command = dialect.CreateCommand(dialect.MarkDispatched)) { command.Parameters.Add(dialect.CreateIdParameter(default(Int64))); return new DbBatchOperation(dialect, command, settings.BatchSize, settings.FlushInterval); } }
/// <summary> /// Initializes a new event store. /// </summary> private void Initialize() { Log.Trace("Initializing event store"); using (var command = dialect.CreateCommand(dialect.EnsureCommitTableExists)) dialect.ExecuteNonQuery(command); // NOTE: Most durable message queues ensure `at least once` delivery of messages; however when using an internal message // queue (i.e., BlockingCollection) or non-durable message queue (i.e., IPC via named pipes) duplicate commits may // not need to be enforced. Allow additional commit ID unique index be created/droped as desired. using (var command = dialect.CreateCommand(detectDuplicateCommits ? dialect.EnsureDuplicateCommitsDetected : dialect.EnsureDuplicateCommitsSuppressed)) dialect.ExecuteNonQuery(command); }