摘要: 一:实现方式 1.aop+锁 (推荐) 2.queue队列 1.之前我们说过,如果锁加在事务里,锁会有问题,建议锁上移,所以本次aop切面为controller层 /** * 并发锁 * * @author jiang */ @Documented @Retention(RetentionPolic 阅读全文
posted @ 2020-04-21 11:21 jwcc 阅读(451) 评论(0) 推荐(1) 编辑
摘要: 一: 先上结论,如果把锁放在事务里面,会出现脏读数据,解决方案:锁上移。 1.有问题的代码: @Service public class SeckillServiceImpl extends ServiceImpl<SeckillMapper, Seckill> implements ISeckil 阅读全文
posted @ 2020-04-21 08:54 jwcc 阅读(355) 评论(0) 推荐(0) 编辑