Write skew is a concurrency anomaly in which transactions update different shared references while jointly violating a constraint that spans them. Snapshot isolation can allow each transaction’s individual work to appear valid even when their combined result is not. section 14.4
When a transaction depends on a constraint shared by multiple refs, use ensure to make that dependency part of the transaction’s consistency check. A conflicting change then causes the transaction to retry rather than silently accepting a stale observation. section 14.4
Protecting a honeypot threshold
A voting system stores honeypot and candidate counts in separate refs. Each batch calls (ensure (votes "honeypot")) before accepting votes while the honeypot count remains below five. Two concurrent batches produce {:total-votes 115, :winner "candidate-1", :fraud? true}; the shared threshold is incorporated into transaction validation. section 14.4
