Interface IPersistManyOwnedAction<TItem>
- Namespace
- FishMMO.Database.Npgsql.Services.Interfaces.Actions
- Assembly
- FishMMO-DB.dll
Defines an ownership-gated persist operation for a collection of per-character rows.
public interface IPersistManyOwnedAction<TItem>
Type Parameters
TItemThe row type being persisted.
Remarks
The write a scene server makes for a character it holds. A row lands only while its character's session claim is still held under the triple the writer quotes, and the check is held under a lock for the rest of the write's transaction, so a release cannot slip in between — see CharacterWriteGate. The ungated IPersistManyAction<TItem> remains for writers that hold no claim by design (character creation) and for writes already inside a unit of work that asserted ownership itself.
Methods
PersistOwnedAsync(IEnumerable<TItem>, IReadOnlyCollection<CharacterSessionLeaseData>, CancellationToken)
Persists the rows whose characters the writer still owns.
Task<DatabaseResult<BulkWriteResult>> PersistOwnedAsync(IEnumerable<TItem> items, IReadOnlyCollection<CharacterSessionLeaseData> claims, CancellationToken cancellationToken = default)
Parameters
itemsIEnumerable<TItem>Rows to persist.
claimsIReadOnlyCollection<CharacterSessionLeaseData>The claim held for each character the rows name, as captured with them.
cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Task<DatabaseResult<BulkWriteResult>>
What the write did. Rows of a live character whose claim is not held are counted as Unowned (and so as filtered). The write fails with Forbidden when it could touch none of its characters for that reason, and with NotFound when none exists.