The default CosmosDb consistency level (Session) involves round-tripping a SessionToken value between the outcome of a given request through to its successors(s) in order to achieve Read-Your-Writes.
Necessary steps off the top of my head:
- grabbing (probably inside the stored proc too?), the token from the response
- propagating it (likely stashing it in the Cosmos.Token alongside the etag etc, although the way the DocDb client holds the value will probably be sufficient in this local case) outward with the response
- exposing it in the processing context for both
Query and Transact options (similarly to how the Version is exposed to QueryEx; if it's to go there, it likely makes sense to provide a Context record bearing both of those - having Version available for the Transact side is currently not covered)
cc @thednaz
The default CosmosDb consistency level (Session) involves round-tripping a
SessionTokenvalue between the outcome of a given request through to its successors(s) in order to achieve Read-Your-Writes.Necessary steps off the top of my head:
QueryandTransactoptions (similarly to how theVersionis exposed toQueryEx; if it's to go there, it likely makes sense to provide aContextrecord bearing both of those - havingVersionavailable for theTransactside is currently not covered)cc @thednaz