This is a follow-up to a question from How to iterate over values upon validation
In my bid service I'd like to make sure that each submitted bid has a price higher than the one before. However, several bids may be submitted by different users at at the same time. This means:
- I'd like to "lock" each submitted bid, validate it against that previous ones, save if it's valid or reject if not, and then break that lock. That is, each bid should be processed one at a time, and not in parallel.
- Next, Move on to the next bid. Validate it as-well, making sure the previous one's price is taken into account.
How would I approach this? I assume STM needs to come into play here, but I haven't seen such an example on IHP yet.