{"record":{"id":"e0fbab9904009dbc","repo":"paascloud/paascloud-master","slug":"uac10015006","errorCode":"UAC10015006","errorMessage":"更新组织信息失败,groupId=%s","messagePattern":"更新组织信息失败,groupId=(.+?)","errorType":"error_code","errorClass":"UacBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacGroupServiceImpl.java","lineNumber":138,"sourceCode":"\t\tint result = uacGroupMapper.updateByPrimaryKeySelective(uacGroup);\n\t\t// 获取当前所选组织的所有子节点\n\t\tList<GroupZtreeVo> childUacGroupList = this.getGroupTree(uacGroup.getId());\n\t\t// 批量修改组织状态\n\t\tif (PublicUtil.isNotEmpty(childUacGroupList)) {\n\t\t\tUacGroup childGroup;\n\t\t\tfor (GroupZtreeVo uacGroup1 : childUacGroupList) {\n\t\t\t\tif (UacGroupStatusEnum.ENABLE.getStatus() == status) {\n\t\t\t\t\tUacGroup parentGroup = uacGroupMapper.selectByPrimaryKey(uacGroup1.getpId());\n\t\t\t\t\tif (parentGroup.getStatus() == UacGroupStatusEnum.DISABLE.getStatus()) {\n\t\t\t\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10015003);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tchildGroup = new UacGroup();\n\t\t\t\tchildGroup.setStatus(uacGroup.getStatus());\n\t\t\t\tchildGroup.setId(uacGroup1.getId());\n\t\t\t\tresult = uacGroupMapper.updateByPrimaryKeySelective(childGroup);\n\t\t\t\tif (result < 1) {\n\t\t\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10015006, uacGroup1.getId());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t@Override\n\tpublic int deleteUacGroupById(Long id) {\n\n\t\tPreconditions.checkArgument(id != null, \"组织id为空\");\n\t\tPreconditions.checkArgument(!Objects.equals(id, GlobalConstant.Sys.SUPER_MANAGER_GROUP_ID), \"该组织不能删除\");\n\n\t\t// 根据前台传入的组织参数校验该组织是否存在\n\t\tUacGroup uacGroup = uacGroupMapper.selectByPrimaryKey(id);\n\t\tif (PublicUtil.isEmpty(uacGroup)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10015004, id);\n\t\t}\n\t\t//判断该组织下是否存在子节点","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacGroupServiceImpl.java#L120-L156","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nresult = uacGroupMapper.updateByPrimaryKeySelective(childGroup);\nif (result < 1) {\n    throw new UacBizException(ErrorCodeEnum.UAC10015006, uacGroup1.getId());\n}\n// after\nUacGroup existing = uacGroupMapper.selectByPrimaryKey(uacGroup1.getId());\nif (existing == null) {\n    continue; // child was deleted concurrently; skip\n}\nchildGroup.setVersion(existing.getVersion() + 1); // satisfy optimistic lock if used\nresult = uacGroupMapper.updateByPrimaryKeySelective(childGroup);","handlingStrategy":"retry","validationCode":"UacGroup child = uacGroupMapper.selectByPrimaryKey(childId);\nif (child == null) { /* skip: deleted concurrently */ return; }","typeGuard":null,"tryCatchPattern":"try {\n    uacGroupService.updateUacGroupStatusById(groupId, status);\n} catch (UacBizException e) {\n    if (ErrorCodeEnum.UAC10015006.getCode().equals(e.getCode())) { /* re-query children and retry in a fresh transaction */ }\n    else throw e;\n}","preventionTips":["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"],"tags":["database","update","optimistic-lock","mybatis"],"backgroundTag":"database-write-failed","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}