@Transactional
public void auditPatient(UserProfileModifyReq userProfileModifyReq) {
//数据更新操作
Map headerMap = new HashMap();
headerMap.put("Content-type", "application/json");
String resultJson = HttpUtil.postString(url, JsonUtil.toJson(paramMap), "utf-8", headerMap);
TMsgResponse tMsgResponse = JsonUtil.toObject(resultJson, TMsgResponse.class);
if (tMsgResponse.getRespCode() != 0) {
LogUtil.logError.error("调用患者实名认证服务失败!错误码:" + tMsgResponse.getRespCode() + ";错误消息:" + tMsgResponse.getRespMsg());
throw new RuntimeException("调用患者实名认证服务失败!");
}
}
其中调用的url接口里service方法:
@Transactional
public void matchUserMerge(MatchUserMergeReq req) {
//数据更新操作
}
这两个同时又事务时,第二个更新就会报死锁问题。
只要把第一个方法的事务去掉就没事了。
求解是怎么回事,同时想要都加事务该如何做?