Background
Polecat already consumes JasperFx.IRevisioned (int) — revision column is int, reads via GetInt32. This issue adds support for the new JasperFx.ILongVersioned (long) so documents projected from a MultiStreamProjection (where Version is the global event sequence number, exceeding Int32) can track a 64-bit revision.
Depends on jasperfx#348 (adds JasperFx.ILongVersioned).
What to change
-
IRevisioned (int) — no change. Already works.
-
Add ILongVersioned (long) support. Decision D2 = widen the revision column to bigint always (matches Marten; IRevisioned docs downcast on read). Touch points:
src/Polecat/Storage/DocumentTable.cs:30 — AddColumn("version", "int") → bigint. Add a non-destructive widening migration for existing int revision columns.
- Reader paths currently use
reader.GetInt32(0) (e.g. UpdateOperation.cs:111, DocumentProvider.cs, QuerySession.cs, InsertOperation.cs, UpsertOperation.cs, AdvancedSqlResultReader.cs, DeserializingSelector.cs). Read as Int64; assign to IRevisioned.Version via downcast to int, or to ILongVersioned.Version directly.
_expectedRevision is int (UpdateOperation.cs:17); add a long path for ILongVersioned.
DocumentMapping.UseNumericRevisions (:92,134) already gates the int path — extend to recognize ILongVersioned as well.
DocumentSessionBase store path (:282) and Insert/Update/Upsert operations: handle both interfaces.
-
Docs: document IRevisioned (int) vs ILongVersioned (long), recommending ILongVersioned for MultiStreamProjection-derived documents where Version is the event sequence number.
Acceptance
Refs
Depends on: jasperfx#348 · Pillar: JasperFx/jasperfx#214
Background
Polecat already consumes
JasperFx.IRevisioned(int) — revision column isint, reads viaGetInt32. This issue adds support for the newJasperFx.ILongVersioned(long) so documents projected from aMultiStreamProjection(whereVersionis the global event sequence number, exceedingInt32) can track a 64-bit revision.Depends on jasperfx#348 (adds
JasperFx.ILongVersioned).What to change
IRevisioned (int)— no change. Already works.Add
ILongVersioned (long)support. Decision D2 = widen the revision column tobigintalways (matches Marten;IRevisioneddocs downcast on read). Touch points:src/Polecat/Storage/DocumentTable.cs:30—AddColumn("version", "int")→bigint. Add a non-destructive widening migration for existingintrevision columns.reader.GetInt32(0)(e.g.UpdateOperation.cs:111,DocumentProvider.cs,QuerySession.cs,InsertOperation.cs,UpsertOperation.cs,AdvancedSqlResultReader.cs,DeserializingSelector.cs). Read asInt64; assign toIRevisioned.Versionvia downcast to int, or toILongVersioned.Versiondirectly._expectedRevisionisint(UpdateOperation.cs:17); add alongpath forILongVersioned.DocumentMapping.UseNumericRevisions(:92,134) already gates the int path — extend to recognizeILongVersionedas well.DocumentSessionBasestore path (:282) and Insert/Update/Upsert operations: handle both interfaces.Docs: document
IRevisioned(int) vsILongVersioned(long), recommendingILongVersionedforMultiStreamProjection-derived documents whereVersionis the event sequence number.Acceptance
bigint; non-destructive widening migration from existingintcolumnsIRevisioned(int) continues to work (downcast on read)ILongVersioned(long) supported end-to-end (store, concurrency check, read-back)ILongVersioneddoc with Version > Int32.MaxValueRefs
Depends on: jasperfx#348 · Pillar: JasperFx/jasperfx#214