leventovL
Convex Community3mo ago
3 replies
leventov

Optimistic concurrency control guarantees

Do I understand correctly that https://docs.convex.dev/database/advanced/occ works by checking the "index query document sets" before writes, not just the docs that literally have been read? That is, all indexes (or whole table scans) that would have returned different results if mutation restarted again that have been performed within the mutation are re-checked (metaphorically) before the transaction is committed?

As far as I can see this isn't spelled out clearly in the docs anywhere (only the prototypical yet simplistic financial transaction example is used, in which only the literal returned doc's change is at play, not index query), yet this information is critical for clear understanding of OCC in Convex.
Optimistic concurrency control and transaction atomicity in Convex
OCC and Atomicity | Convex Developer Hub
Was this page helpful?