Where records live. One method, and it MUST be atomic: read the record for
(scope, id), run decide on it, and if the answer is apply,
write the record that recordFor returns, all as one operation. Anything
less lets two events for one entity both pass.
To keep the record and your own write together, run advance inside the
same database transaction as your write, so a failed write rolls the record
back too. checkStore runs the contract against an implementation.
Where records live. One method, and it MUST be atomic: read the record for
(scope, id), run decide on it, and if the answer isapply, write the record thatrecordForreturns, all as one operation. Anything less lets two events for one entity both pass.To keep the record and your own write together, run
advanceinside the same database transaction as your write, so a failed write rolls the record back too.checkStoreruns the contract against an implementation.