Regarding the PHP concurrency issue, does MYSQL have a mechanism to prevent concurrency? can you explain it. For example, if the inventory is only 1, after the two users buy one at the same time, it will be negative .. But no PHP execution, let the SQL to complete this operation a = A-1... wherea & gt; 0 can solve it. There is a lack of knowledge in this area. I don't know if there is any post from my predecessors. Please check it out. thank you, http: // ou.
Does MYSQL have a mechanism to prevent concurrency? can you explain it.
For example, if the inventory is only 1, after the two users buy one at the same time, it will be negative ..
But no PHP execution, let the SQL to complete this operation a = A-1... where a> 0 can solve it.
There is a lack of knowledge in this area. I don't know if there is any post from my predecessors. Please check it out. thank you.
------ Solution --------------------
Http://ourmysql.com/archives/857
Http://www.orczhou.com/index.php/2010/06/mysql-innodb-source-code-sync-1/
Http://www.cnblogs.com/perfectdesign/archive/2009/12/05/1617508.html
------ Solution --------------------
MYSQL has a concurrency mechanism to prevent access conflicts between different users.
Let SQL to complete this operation a = A-1... where a> 0 can prevent the existence of inventory as negative phenomenon
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service