Hi there,
I've noticed that when the stream is commited, NES performs a read first to detect concurrency:
using (IEventStream eventStream = this._eventStore.OpenStream(bucketId, id, version, int.MaxValue))
{
EventStoreAdapter.Logger.Debug("Opened stream has StreamRevision {0}", (object) eventStream.StreamRevision);
if (version != eventStream.StreamRevision && Transaction.Current != (Transaction) null)
{
throw new ConflictingCommandException
Still there's a possibility for concurrency issue this way (result of OpenStream becomes stale immediately). I am using NEventStore with SQL persistence and the consistency of event stream is guaranteed by the database (PK on bucket, streamId and version). So the OpenStream looks like a redundant action in that case for me.
Please comment on that, thank you!
Hi there,
I've noticed that when the stream is commited, NES performs a read first to detect concurrency:
Still there's a possibility for concurrency issue this way (result of
OpenStreambecomes stale immediately). I am using NEventStore with SQL persistence and the consistency of event stream is guaranteed by the database (PK on bucket, streamId and version). So theOpenStreamlooks like a redundant action in that case for me.Please comment on that, thank you!