新增悲观锁

This commit is contained in:
tianfeng 2025-09-19 18:52:49 +08:00
parent 31e7b3239f
commit 41fa4726ad

View File

@ -63,7 +63,8 @@ public class FragmentsBackpackServiceImpl extends
.setSql("quantity=quantity-" + quantity)
.in(FragmentsBackpack::getFragmentsId, fragmentsIds)
.eq(FragmentsBackpack::getUserId, userId)
.last(PageConstant.formatLimit(fragmentsIds.size()))
.ge(FragmentsBackpack::getQuantity, quantity)
.last(PageConstant.formatLimit(fragmentsIds.size()) + " FOR UPDATE")
.execute();
}