php - Ask me about mysql transactions, locks and transactions?
代言
代言 2017-06-24 09:41:23
0
1
854

For example, if the account balance is 100 yuan, if the balance is greater than the transaction amount during the transaction, the transaction will be successful.
Now assuming that this user has multiple transactions at the same time, there will be problems during detection.

question:

  1. I would like to ask if using the SERIERLIZED isolation level of the transaction can solve this problem at this time.

  2. Or lock this row of data. How to add this lock?

代言
代言

reply all(1)
阿神
  1. This problem can be solved, but the performance may drop drastically

  2. You can add optimistic lock

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!