国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

php - How to ensure data security when one operation requests multiple services?
我想大聲告訴你
我想大聲告訴你 2017-05-25 15:08:18
0
3
961

An order operation to purchase goods.
To reduce user points at the same time, insert an order.
In the same library, you can add pessimistic locking to the points table to prevent concurrently generated data from being read multiple times.
Now that HTTP is used to request points service and order service, how to use locking? To prevent reducing the points into negative numbers

==================
The items are point services, points services, and order services. The database is also separate. The lock doesn't work

我想大聲告訴你
我想大聲告訴你

reply all(3)
我想大聲告訴你

Can use transaction mechanism

迷茫

Points can be made using redis

巴扎黑

You have to consider whether there will be concurrency problems. If there are concurrency problems, it is recommended to put queues + things for processing.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template