悲觀鎖
synchronized以及ReentrantLock都是悲觀鎖:
樂觀鎖
加version版本號
select
amount,
version
from test_thread.u_amount
where u_id = #{ userId }
使用如下就可解決高併發問題 原因?
悲觀鎖
synchronized以及ReentrantLock都是悲觀鎖:
樂觀鎖
加version版本號
select
amount,
version
from test_thread.u_amount
where u_id = #{ userId }
使用如下就可解決高併發問題 原因?
https://blog.csdn.net/qq_62571013/article/details/137224518