You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without ifNotPresent key-value record will be updated even if it has the same value. For example if you have {"key":"a", "value":"42", "generationId":"001"} stored in the database and next generationId is 002, if you'll /put{"key":"a", "value":"42"}, new record {"key":"a", "value":"42", "generationId":"002"} will be created.
We need to add ifChanged option to read previous stored value and update it only if it was changed.
This option should read value from current generation, not from the next one. Else if we have value A and two requests one of which wants to write A, second one wants to write B, B is faster, writes B, responds with wasPut: true, then first one checks that there is B, writes A back and responds with wasPut: true too. Later we'll add CAS that will check value in the next generation.
The text was updated successfully, but these errors were encountered:
Rulexec
changed the title
add ifChanged option to put method
Add ifChanged option to put method
Feb 24, 2023
Without
ifNotPresent
key-value record will be updated even if it has the same value. For example if you have{"key":"a", "value":"42", "generationId":"001"}
stored in the database and nextgenerationId
is002
, if you'll/put
{"key":"a", "value":"42"}
, new record{"key":"a", "value":"42", "generationId":"002"}
will be created.We need to add
ifChanged
option to read previous stored value and update it only if it was changed.This option should read value from current generation, not from the next one. Else if we have value
A
and two requests one of which wants to writeA
, second one wants to writeB
,B
is faster, writesB
, responds withwasPut: true
, then first one checks that there isB
, writesA
back and responds withwasPut: true
too. Later we'll add CAS that will check value in the next generation.The text was updated successfully, but these errors were encountered: