paascloud/paascloud-master · error · UacBizException
UAC10015006
UAC10015006
Error message
更新组织信息失败,groupId=%s
What it means
UAC10015006 ("更新组织信息失败,groupId=%s") is thrown when updateByPrimaryKeySelective returns fewer than 1 affected rows while cascading a status change to child groups. It signals the child-group status update silently failed (no row matched or optimistic-lock/version conflict).
Solutions
- Re-query the child group list immediately before updating to avoid stale ids
- Check whether the child row still exists and skip/deal with missing ones instead of a blanket update
- Catch UacBizException UAC10015006, log the groupId, and retry the operation in a fresh transaction
Example fix
// before
result = uacGroupMapper.updateByPrimaryKeySelective(childGroup);
if (result < 1) {
throw new UacBizException(ErrorCodeEnum.UAC10015006, uacGroup1.getId());
}
// after
UacGroup existing = uacGroupMapper.selectByPrimaryKey(uacGroup1.getId());
if (existing == null) {
continue; // child was deleted concurrently; skip
}
childGroup.setVersion(existing.getVersion() + 1); // satisfy optimistic lock if used
result = uacGroupMapper.updateByPrimaryKeySelective(childGroup); Defensive patterns
Strategy: retry
Validate before calling
UacGroup child = uacGroupMapper.selectByPrimaryKey(childId);
if (child == null) { /* skip: deleted concurrently */ return; } Try / catch
try {
uacGroupService.updateUacGroupStatusById(groupId, status);
} catch (UacBizException e) {
if (ErrorCodeEnum.UAC10015006.getCode().equals(e.getCode())) { /* re-query children and retry in a fresh transaction */ }
else throw e;
} Prevention
- Re-read the child list inside the same transaction as the updates
- Run the status cascade in one transaction so partial failures roll back
- Watch for optimistic-lock version conflicts when other admins edit groups
When it happens
Trigger: During updateUacGroupStatusById, the loop over childUacGroupList executes uacGroupMapper.updateByPrimaryKeySelective(childGroup) and result < 1 — the child row was deleted concurrently, the id is stale, or a version/where clause prevented the update.
Common situations: Concurrent deletion of child groups during a parent status change; stale child list read before the loop; database replica/transaction visibility issues; version column mismatch after other updates.
Related errors
AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10).
Data as JSON: /api/errors/e0fbab9904009dbc.
Report an issue: GitHub.
Appendix: source
Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacGroupServiceImpl.java:138
int result = uacGroupMapper.updateByPrimaryKeySelective(uacGroup);
// 获取当前所选组织的所有子节点
List<GroupZtreeVo> childUacGroupList = this.getGroupTree(uacGroup.getId());
// 批量修改组织状态
if (PublicUtil.isNotEmpty(childUacGroupList)) {
UacGroup childGroup;
for (GroupZtreeVo uacGroup1 : childUacGroupList) {
if (UacGroupStatusEnum.ENABLE.getStatus() == status) {
UacGroup parentGroup = uacGroupMapper.selectByPrimaryKey(uacGroup1.getpId());
if (parentGroup.getStatus() == UacGroupStatusEnum.DISABLE.getStatus()) {
throw new UacBizException(ErrorCodeEnum.UAC10015003);
}
}
childGroup = new UacGroup();
childGroup.setStatus(uacGroup.getStatus());
childGroup.setId(uacGroup1.getId());
result = uacGroupMapper.updateByPrimaryKeySelective(childGroup);
if (result < 1) {
throw new UacBizException(ErrorCodeEnum.UAC10015006, uacGroup1.getId());
}
}
}
return result;
}
@Override
public int deleteUacGroupById(Long id) {
Preconditions.checkArgument(id != null, "组织id为空");
Preconditions.checkArgument(!Objects.equals(id, GlobalConstant.Sys.SUPER_MANAGER_GROUP_ID), "该组织不能删除");
// 根据前台传入的组织参数校验该组织是否存在
UacGroup uacGroup = uacGroupMapper.selectByPrimaryKey(id);
if (PublicUtil.isEmpty(uacGroup)) {
throw new UacBizException(ErrorCodeEnum.UAC10015004, id);
}
//判断该组织下是否存在子节点View on GitHub (pinned to 781281a950)