ITeye博客

springcloud分布式服务脏读死锁解决方案

coffeehot · 2017-08-23 11:33 · framework · springcloud · 企业架构 · Markdown

解决springcloud分布式服务脏读死锁等异常

查询更新同一张表时,需要采用select...for update进行行级锁

//设置事务传播特性及隔离级别
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, rollbackFor = {Throwable.class})
select
<include refid="Base_Column_List" />
from t_account_detail t
where t.user_id = #{userId}
for update;

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。