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:
I would like to ask if using the SERIERLIZED isolation level of the transaction can solve this problem at this time.
Or lock this row of data. How to add this lock?
阿神2017-06-24 09:43:23
This problem can be solved, but the performance may drop drastically
You can add optimistic lock