Skip to main content
Table of Contents

Class ConcurrencyException

Namespace
Stratara.Abstractions.EventSourcing
Assembly
Stratara.Abstractions.dll

Thrown by SaveChangesAsync(CancellationToken) when another writer committed to the same stream first and the optimistic version check fails. Callers should re-aggregate and retry the operation idempotently.

public sealed class ConcurrencyException : Exception, ISerializable
Inheritance
ConcurrencyException
Implements
Inherited Members
Extension Methods

Constructors

ConcurrencyException(Guid, string, Exception?)

Initialise a new ConcurrencyException.

public ConcurrencyException(Guid streamId, string aggregateTypeName, Exception? innerException = null)

Parameters

streamId Guid

The stream that lost the race.

aggregateTypeName string

The aggregate type bound to the stream — for diagnostics.

innerException Exception

Optional inner exception (typically the underlying DB exception).

Properties

AggregateTypeName

The aggregate type bound to the stream.

public string AggregateTypeName { get; }

Property Value

string

StreamId

The stream id that experienced the concurrent write.

public Guid StreamId { get; }

Property Value

Guid