26

关于乐观锁与悲观锁的实际应用

 5 years ago
source link: https://juejin.im/post/5c0009adf265da614a3a3741
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
开门见山,先聊一聊我实际遇到的业务问题:在项目中有一个竞猜下注的功能,它的赔率是根据A队和B队两边的下注总金额来计算的。于是当有用户下注某一边时,两边的赔率都会进行相应的变化。反应到数据库里就是(简化版本),一个人下注,会更改数据库盘口表的几个字段:A队赔率,

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK