mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3951: Data concurrency because doctrine use SET column_name = value instead of SET column_name = column_name + difference_value #4834
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Oct 13, 2015).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user hendrahuang:
I am using doctrine2 with symfony2. I have problem about data concurrency. Here is my case.
I create a website for ecommerce. Lets say I have product A with quantity = 5. Customer A buy 4 items of product A and Customer B buy 2 items of product A at the same time.
For customer A case, first doctrine query product A and the initial quantity is 5. Then doctrine update the quantity and set it to 1 (5 - 4).
For customer B case, the initial quantity of product A is still 5 because customer B and customer A buy that product at the same time, so they get the same initial quantity. Then doctrine update the quantity to 3 (5 - 2).