-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
Suppose we have e-commerce website with hot sales. There often can be a case where product stock is decremented in parallel requests.
Solution can be to use mysql directly UPDATE product SET stock=stock-1.
But it has drawbacks. For example task is "Create order and reduce stock". I reduce stock with direct mysql query, but during
->flush() exception appears and order not saved. So I have reduced stock and no order.
Is there a way UPDATE product SET stock=stock-1 to be persisted, so it will execute with other updates when ->flush() is called?
Metadata
Metadata
Assignees
Labels
No labels