Authored by BuddyJack

Fix transaction

@@ -6,6 +6,7 @@ import com.model.TypeInfo; @@ -6,6 +6,7 @@ import com.model.TypeInfo;
6 import com.monitor.cmdb.service.IMObjectInfoService; 6 import com.monitor.cmdb.service.IMObjectInfoService;
7 import com.monitor.model.response.DependencyRep; 7 import com.monitor.model.response.DependencyRep;
8 import com.monitor.mysql.mapper.MObjectInfoMapper; 8 import com.monitor.mysql.mapper.MObjectInfoMapper;
  9 +import com.yoho.core.dal.datasource.annotation.Database;
9 import lombok.Getter; 10 import lombok.Getter;
10 import org.apache.commons.lang.StringUtils; 11 import org.apache.commons.lang.StringUtils;
11 import org.springframework.beans.factory.annotation.Autowired; 12 import org.springframework.beans.factory.annotation.Autowired;
@@ -199,6 +200,8 @@ public class MObjectInfoServiceImpl implements IMObjectInfoService { @@ -199,6 +200,8 @@ public class MObjectInfoServiceImpl implements IMObjectInfoService {
199 * @param dependencyList 200 * @param dependencyList
200 */ 201 */
201 @Override 202 @Override
  203 + @Transactional
  204 + @Database(DataSource = "yh_ops")
202 public void updateBindDependency(int typeId, List<String> dependencyList) { 205 public void updateBindDependency(int typeId, List<String> dependencyList) {
203 Map<String, TypeInfo> allDependencies = queryAllDependencies(); 206 Map<String, TypeInfo> allDependencies = queryAllDependencies();
204 List<DependencyInfo> dependencyInfoList = new ArrayList<>(); 207 List<DependencyInfo> dependencyInfoList = new ArrayList<>();