当前位置:网站首页>数据一致的问题

数据一致的问题

2022-06-11 09:28:00 宇1990

悲观锁

synchronized以及ReentrantLock都是悲观锁:

乐观锁

加version版本号

  select
         amount,
         version
         from test_thread.u_amount
         where u_id = #{ userId }

使用如下就可解决高并发问题   原因?

 

 

 

原网站

版权声明
本文为[宇1990]所创,转载请带上原文链接,感谢
https://blog.csdn.net/wenzhenyu1990/article/details/101519851