How to achieve itempotency when incrementing a database column via PUT? (For example a credits-count in a purchase process)
+4
A:
Send a unique transaction id with every request, store all executed transaction ids and don't react to requests with a transaction id that you already saw.
Joachim Sauer
2010-03-09 13:29:14
Jinx! I deleted mine, didn't add any value over yours.
T.J. Crowder
2010-03-09 13:33:03
Ah, I think that's exaclty what we need. Are there any best practises / plugins for that?
metafoo
2010-03-09 13:47:57
This way works, but if the increment is constant you lose that property. It will just work as you can increment by any amount or you have to do a validation and see if the id is correct
Diego Dias
2010-03-09 13:52:28