select for update在springboot里实现分布式锁
摘要:
// mapper,注意,这里的参数最好就是主键或者唯一键,否则产生的是表锁,script可以省略 @Select("<script> select* from foo where id = #{id} for update</script>") Foo selectForUpdateById(@P 阅读全文
posted @ 2023-12-12 17:47 Silentdoer 阅读(302) 评论(0) 推荐(0)