mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 05:29:29 +08:00
fix(数据库连接池): 修复数据库连接池在大压力下容易出现获取不到的问题
修复数据库连接池在大压力下容易出现获取不到的问题
This commit is contained in:
parent
69b2ab7a70
commit
454fcb9933
@ -68,6 +68,7 @@ import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.apache.jorphan.collections.HashTree;
|
||||
import org.apache.jorphan.collections.ListedHashTree;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -1468,8 +1469,12 @@ public class ApiAutomationService {
|
||||
report.setStatus(APITestStatus.Waiting.name());
|
||||
batchMapper.insert(report);
|
||||
}
|
||||
sqlSession.commit();
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
// 开始串行执行
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
@ -1572,8 +1577,10 @@ public class ApiAutomationService {
|
||||
batchMapper.insert(report);
|
||||
MessageCache.scenarioExecResourceLock.put(reportId, report);
|
||||
}
|
||||
sqlSession.commit();
|
||||
sqlSession.clearCache();
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
});
|
||||
thread.start();
|
||||
@ -1595,7 +1602,6 @@ public class ApiAutomationService {
|
||||
TriggerMode.BATCH.name().equals(request.getTriggerMode()) ? TriggerMode.BATCH.name() : request.getReportId(), request.getRunMode());
|
||||
}
|
||||
}
|
||||
executeQueue.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1705,6 +1711,9 @@ public class ApiAutomationService {
|
||||
}
|
||||
testPlan.toHashTree(jmeterHashTree, testPlan.getHashTree(), new ParameterConfig());
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
MSException.throwException(ex.getMessage());
|
||||
}
|
||||
@ -1979,6 +1988,9 @@ public class ApiAutomationService {
|
||||
}
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
@ -2318,6 +2330,9 @@ public class ApiAutomationService {
|
||||
}
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
private Long getImportNextOrder(String projectId) {
|
||||
|
@ -59,6 +59,7 @@ import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.apache.jorphan.collections.HashTree;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -1145,6 +1146,9 @@ public class ApiDefinitionService {
|
||||
if (!CollectionUtils.isEmpty(apiImport.getCases())) {
|
||||
importMsCase(apiImport, sqlSession, request);
|
||||
}
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -102,11 +103,19 @@ public class ApiEnvironmentRunningParamService {
|
||||
sqlSession = sqlSessionFactory.openSession(ExecutorType.SIMPLE);
|
||||
ApiTestEnvironmentMapper batchMapper = sqlSession.getMapper(ApiTestEnvironmentMapper.class);
|
||||
batchMapper.updateByPrimaryKeyWithBLOBs(apiTestEnvironmentWithBLOBs);
|
||||
sqlSession.commit();
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}catch (Exception e){
|
||||
sqlSession.rollback();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}finally {
|
||||
sqlSession.close();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -353,6 +354,9 @@ public class ApiModuleService extends NodeTreeService<ApiModuleDTO> {
|
||||
apiDefinitionMapper.updateByPrimaryKeySelective(value);
|
||||
});
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -432,6 +436,9 @@ public class ApiModuleService extends NodeTreeService<ApiModuleDTO> {
|
||||
apiModuleMapper.updateByPrimaryKeySelective(value);
|
||||
});
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
public ApiModule getModuleByName(String projectId, String protocol) {
|
||||
|
@ -27,6 +27,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@ -289,6 +290,9 @@ public class ApiScenarioModuleService extends NodeTreeService<ApiScenarioModuleD
|
||||
ApiScenarioMapper apiScenarioMapper = sqlSession.getMapper(ApiScenarioMapper.class);
|
||||
apiScenarios.forEach(apiScenarioMapper::updateByPrimaryKeySelective);
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -395,6 +399,9 @@ public class ApiScenarioModuleService extends NodeTreeService<ApiScenarioModuleD
|
||||
ApiScenarioModuleMapper apiScenarioModuleMapper = sqlSession.getMapper(ApiScenarioModuleMapper.class);
|
||||
updateNodes.forEach(apiScenarioModuleMapper::updateByPrimaryKeySelective);
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
public String getLogDetails(List<String> ids) {
|
||||
|
@ -43,6 +43,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@ -159,6 +160,7 @@ public class ApiScenarioReportService {
|
||||
if (report == null) {
|
||||
LogUtil.info("从缓存中获取场景报告:【" + test.getName() + "】");
|
||||
report = MessageCache.scenarioExecResourceLock.get(test.getName());
|
||||
LogUtil.info("从缓存中获取场景报告:【" + test.getName() + "】是否为空:" + (report == null));
|
||||
}
|
||||
if (report != null) {
|
||||
report.setName(report.getScenarioName() + "-" + DateUtils.getTimeStr(System.currentTimeMillis()));
|
||||
@ -322,88 +324,86 @@ public class ApiScenarioReportService {
|
||||
|
||||
ApiScenarioReport report = editReport(scenarioResult, startTime);
|
||||
|
||||
TestResult newResult = createTestResult(result.getTestId(), scenarioResult);
|
||||
newResult.setConsole(result.getConsole());
|
||||
scenarioResult.setName(report.getScenarioName());
|
||||
newResult.addScenario(scenarioResult);
|
||||
/**
|
||||
* 测试计划的定时任务场景执行时,主键是提前生成的【测试报告ID】。也就是TestResult.id是【测试报告ID】。
|
||||
* report.getScenarioId中存放的是 TestPlanApiScenario.id:TestPlanReport.id 由于参数限制,只得将两个ID拼接起来
|
||||
* 拆分report.getScenarioId, 查出ScenarioId,将真正的场景ID赋值回去
|
||||
* 同时将testPlanReportID存入集合,逻辑走完后更新TestPlanReport
|
||||
*/
|
||||
String[] idArr = report.getScenarioId().split(":");
|
||||
String planScenarioId = null;
|
||||
if (idArr.length > 1) {
|
||||
planScenarioId = idArr[0];
|
||||
String planReportID = idArr[1];
|
||||
if (!testPlanReportIdList.contains(planReportID)) {
|
||||
testPlanReportIdList.add(planReportID);
|
||||
}
|
||||
} else {
|
||||
planScenarioId = report.getScenarioId();
|
||||
}
|
||||
TestPlanApiScenario testPlanApiScenario = testPlanApiScenarioMapper.selectByPrimaryKey(planScenarioId);
|
||||
report.setScenarioId(testPlanApiScenario.getApiScenarioId());
|
||||
report.setTestPlanScenarioId(planScenarioId);
|
||||
report.setEndTime(System.currentTimeMillis());
|
||||
apiScenarioReportMapper.updateByPrimaryKeySelective(report);
|
||||
planScenarioReportMap.put(planScenarioId, report.getId());
|
||||
if(report != null){
|
||||
TestResult newResult = createTestResult(result.getTestId(), scenarioResult);
|
||||
newResult.setConsole(result.getConsole());
|
||||
scenarioResult.setName(report.getScenarioName());
|
||||
|
||||
|
||||
if (scenarioResult.getError() > 0) {
|
||||
scenarioAndErrorMap.put(testPlanApiScenario.getId(), TestPlanApiExecuteStatus.FAILD.name());
|
||||
testPlanApiScenario.setLastResult(ScenarioStatus.Fail.name());
|
||||
} else {
|
||||
scenarioAndErrorMap.put(testPlanApiScenario.getId(), TestPlanApiExecuteStatus.SUCCESS.name());
|
||||
testPlanApiScenario.setLastResult(ScenarioStatus.Success.name());
|
||||
}
|
||||
|
||||
String passRate = new DecimalFormat("0%").format((float) scenarioResult.getSuccess() / (scenarioResult.getSuccess() + scenarioResult.getError()));
|
||||
testPlanApiScenario.setPassRate(passRate);
|
||||
// 报告详情内容
|
||||
ApiScenarioReportDetail detail = new ApiScenarioReportDetail();
|
||||
|
||||
detail.setContent(JSON.toJSONString(newResult).getBytes(StandardCharsets.UTF_8));
|
||||
detail.setReportId(report.getId());
|
||||
detail.setProjectId(report.getProjectId());
|
||||
if (StringUtils.isNotEmpty(report.getTriggerMode()) && report.getTriggerMode().equals("CASE")) {
|
||||
report.setTriggerMode(TriggerMode.MANUAL.name());
|
||||
}
|
||||
apiScenarioReportDetailMapper.insert(detail);
|
||||
|
||||
testPlanApiScenario.setReportId(report.getId());
|
||||
report.setEndTime(System.currentTimeMillis());
|
||||
testPlanApiScenario.setUpdateTime(System.currentTimeMillis());
|
||||
testPlanApiScenarioMapper.updateByPrimaryKeySelective(testPlanApiScenario);
|
||||
scenarioIdList.add(testPlanApiScenario.getApiScenarioId());
|
||||
scenarioNames.append(report.getName()).append(",");
|
||||
|
||||
// 更新场景状态
|
||||
ApiScenario scenario = apiScenarioMapper.selectByPrimaryKey(testPlanApiScenario.getApiScenarioId());
|
||||
if (scenario != null) {
|
||||
if (scenarioResult.getError() > 0) {
|
||||
scenario.setLastResult("Fail");
|
||||
newResult.addScenario(scenarioResult);
|
||||
/**
|
||||
* 测试计划的定时任务场景执行时,主键是提前生成的【测试报告ID】。也就是TestResult.id是【测试报告ID】。
|
||||
* report.getScenarioId中存放的是 TestPlanApiScenario.id:TestPlanReport.id 由于参数限制,只得将两个ID拼接起来
|
||||
* 拆分report.getScenarioId, 查出ScenarioId,将真正的场景ID赋值回去
|
||||
* 同时将testPlanReportID存入集合,逻辑走完后更新TestPlanReport
|
||||
*/
|
||||
String[] idArr = report.getScenarioId().split(":");
|
||||
String planScenarioId = null;
|
||||
if (idArr.length > 1) {
|
||||
planScenarioId = idArr[0];
|
||||
String planReportID = idArr[1];
|
||||
if (!testPlanReportIdList.contains(planReportID)) {
|
||||
testPlanReportIdList.add(planReportID);
|
||||
}
|
||||
} else {
|
||||
scenario.setLastResult("Success");
|
||||
planScenarioId = report.getScenarioId();
|
||||
}
|
||||
scenario.setPassRate(passRate);
|
||||
scenario.setReportId(report.getId());
|
||||
int executeTimes = 0;
|
||||
if (scenario.getExecuteTimes() != null) {
|
||||
executeTimes = scenario.getExecuteTimes().intValue();
|
||||
}
|
||||
scenario.setExecuteTimes(executeTimes + 1);
|
||||
TestPlanApiScenario testPlanApiScenario = testPlanApiScenarioMapper.selectByPrimaryKey(planScenarioId);
|
||||
report.setScenarioId(testPlanApiScenario.getApiScenarioId());
|
||||
report.setTestPlanScenarioId(planScenarioId);
|
||||
report.setEndTime(System.currentTimeMillis());
|
||||
apiScenarioReportMapper.updateByPrimaryKeySelective(report);
|
||||
planScenarioReportMap.put(planScenarioId, report.getId());
|
||||
|
||||
apiScenarioMapper.updateByPrimaryKey(scenario);
|
||||
// 发送通知
|
||||
// sendNotice(scenario);
|
||||
if (scenarioResult.getError() > 0) {
|
||||
scenarioAndErrorMap.put(testPlanApiScenario.getId(), TestPlanApiExecuteStatus.FAILD.name());
|
||||
testPlanApiScenario.setLastResult(ScenarioStatus.Fail.name());
|
||||
} else {
|
||||
scenarioAndErrorMap.put(testPlanApiScenario.getId(), TestPlanApiExecuteStatus.SUCCESS.name());
|
||||
testPlanApiScenario.setLastResult(ScenarioStatus.Success.name());
|
||||
}
|
||||
|
||||
String passRate = new DecimalFormat("0%").format((float) scenarioResult.getSuccess() / (scenarioResult.getSuccess() + scenarioResult.getError()));
|
||||
testPlanApiScenario.setPassRate(passRate);
|
||||
// 报告详情内容
|
||||
ApiScenarioReportDetail detail = new ApiScenarioReportDetail();
|
||||
|
||||
detail.setContent(JSON.toJSONString(newResult).getBytes(StandardCharsets.UTF_8));
|
||||
detail.setReportId(report.getId());
|
||||
detail.setProjectId(report.getProjectId());
|
||||
if (StringUtils.isNotEmpty(report.getTriggerMode()) && report.getTriggerMode().equals("CASE")) {
|
||||
report.setTriggerMode(TriggerMode.MANUAL.name());
|
||||
}
|
||||
apiScenarioReportDetailMapper.insert(detail);
|
||||
|
||||
testPlanApiScenario.setReportId(report.getId());
|
||||
report.setEndTime(System.currentTimeMillis());
|
||||
testPlanApiScenario.setUpdateTime(System.currentTimeMillis());
|
||||
testPlanApiScenarioMapper.updateByPrimaryKeySelective(testPlanApiScenario);
|
||||
scenarioIdList.add(testPlanApiScenario.getApiScenarioId());
|
||||
scenarioNames.append(report.getName()).append(",");
|
||||
|
||||
// 更新场景状态
|
||||
ApiScenario scenario = apiScenarioMapper.selectByPrimaryKey(testPlanApiScenario.getApiScenarioId());
|
||||
if (scenario != null) {
|
||||
if (scenarioResult.getError() > 0) {
|
||||
scenario.setLastResult("Fail");
|
||||
} else {
|
||||
scenario.setLastResult("Success");
|
||||
}
|
||||
scenario.setPassRate(passRate);
|
||||
scenario.setReportId(report.getId());
|
||||
int executeTimes = 0;
|
||||
if (scenario.getExecuteTimes() != null) {
|
||||
executeTimes = scenario.getExecuteTimes().intValue();
|
||||
}
|
||||
scenario.setExecuteTimes(executeTimes + 1);
|
||||
|
||||
apiScenarioMapper.updateByPrimaryKey(scenario);
|
||||
}
|
||||
lastReport = report;
|
||||
MessageCache.executionQueue.remove(report.getId());
|
||||
reportIds.add(report.getId());
|
||||
}
|
||||
|
||||
lastReport = report;
|
||||
|
||||
MessageCache.executionQueue.remove(report.getId());
|
||||
reportIds.add(report.getId());
|
||||
}
|
||||
testPlanLog.info("TestPlanReportId" + JSONArray.toJSONString(testPlanReportIdList) + " EXECUTE OVER. SCENARIO STATUS : " + JSONObject.toJSONString(scenarioAndErrorMap));
|
||||
for (String reportId : testPlanReportIdList) {
|
||||
@ -505,6 +505,9 @@ public class ApiScenarioReportService {
|
||||
scenarioReportMapper.updateByPrimaryKeySelective(scenario);
|
||||
});
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
passRateMap.clear();
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.apache.jorphan.collections.HashTree;
|
||||
import org.apache.jorphan.collections.ListedHashTree;
|
||||
import org.aspectj.util.FileUtil;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -593,6 +594,9 @@ public class ApiTestCaseService {
|
||||
testCaseReviewMapper.updateByPrimaryKey(testCaseReview);
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> selectIdsNotExistsInPlan(String projectId, String planId) {
|
||||
@ -676,6 +680,9 @@ public class ApiTestCaseService {
|
||||
batchMapper.updateByPrimaryKeySelective(apiTestCase);
|
||||
});
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -714,6 +721,9 @@ public class ApiTestCaseService {
|
||||
batchMapper.updateByPrimaryKeySelective(apiTestCase);
|
||||
});
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -788,8 +798,10 @@ public class ApiTestCaseService {
|
||||
batchMapper.insert(report);
|
||||
executeQueue.add(runCaseRequest);
|
||||
}
|
||||
sqlSession.commit();
|
||||
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
for (RunCaseRequest runCaseRequest : executeQueue) {
|
||||
MessageCache.caseExecResourceLock.put(runCaseRequest.getReportId(), runCaseRequest.getReport());
|
||||
run(runCaseRequest);
|
||||
|
@ -38,6 +38,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -448,6 +449,9 @@ public class HistoricalDataUpgradeService {
|
||||
createApiScenarioWithBLOBs(saveHistoricalDataUpgrade, scenarioTest.getId(), scenarioTest.getName(), listSteps.size(), scenarioDefinition, mapper, num);
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
@ -159,6 +160,9 @@ public class ServiceUtils {
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
}
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
MSException.throwException("初始化 order 字段失败");
|
||||
|
@ -59,8 +59,6 @@ public class TestPlanUtils {
|
||||
if (StringUtils.equals(successStatus, status)) {
|
||||
report.setPassCount(report.getPassCount() + 1);
|
||||
}
|
||||
}else {
|
||||
System.out.println(status);
|
||||
}
|
||||
TestPlanUtils.getStatusResultMap(statusResultMap, status);
|
||||
});
|
||||
|
@ -51,6 +51,7 @@ import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.aspectj.util.FileUtil;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -852,6 +853,10 @@ public class PerformanceTestService {
|
||||
scenarioLoadTest.setId(UUID.randomUUID().toString());
|
||||
mapper.insert(scenarioLoadTest);
|
||||
});
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getGranularity(String reportId) {
|
||||
|
@ -12,6 +12,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -111,7 +112,9 @@ public class CustomFieldTemplateService {
|
||||
});
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
sqlSession.close();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,6 +28,7 @@ import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -199,6 +200,9 @@ public class GroupService {
|
||||
}
|
||||
});
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Group> getGroupByType(EditGroupRequest request) {
|
||||
@ -438,6 +442,9 @@ public class GroupService {
|
||||
mapper.insertSelective(userGroup);
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -467,6 +474,9 @@ public class GroupService {
|
||||
mapper.insertSelective(userGroup);
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -249,6 +250,9 @@ public class RelationshipEdgeService {
|
||||
}
|
||||
});
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
private RelationshipEdge getNewRelationshipEdge(String graphId, String sourceId, String targetId, String type) {
|
||||
|
@ -48,6 +48,7 @@ import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.*;
|
||||
import org.apache.shiro.authz.UnauthorizedException;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -154,6 +155,9 @@ public class UserService {
|
||||
mapper.insertSelective(userGroup);
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -856,6 +860,9 @@ public class UserService {
|
||||
mapper.insertSelective(userGroup);
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -903,6 +910,9 @@ public class UserService {
|
||||
mapper.insertSelective(userGroup);
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1226,6 +1236,9 @@ public class UserService {
|
||||
mapper.insertSelective(userGroup);
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@ -568,6 +569,9 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
|
||||
testCaseNodeMapper.updateByPrimaryKeySelective(value);
|
||||
});
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
private void batchUpdateTestCase(List<TestCaseDTO> testCases) {
|
||||
@ -577,6 +581,9 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
|
||||
testCaseMapper.updateByPrimaryKeySelective(value);
|
||||
});
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
private List<TestCaseDTO> QueryTestCaseByNodeIds(List<String> nodeIds) {
|
||||
@ -678,6 +685,9 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
|
||||
testCaseNodeMapper.updateByPrimaryKey(node);
|
||||
});
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@ import io.metersphere.track.request.testreview.TestReviewRequest;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@ -88,6 +89,9 @@ public class TestCaseReviewLoadService {
|
||||
testCaseReviewMapper.updateByPrimaryKey(testCaseReview);
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
public void delete(String id) {
|
||||
@ -104,7 +108,7 @@ public class TestCaseReviewLoadService {
|
||||
testCaseReviewLoadMapper.updateByPrimaryKeySelective(testCaseReviewLoad);
|
||||
return reportId;
|
||||
}
|
||||
//???
|
||||
|
||||
public Boolean isExistReport(LoadCaseReportRequest request) {
|
||||
String reportId = request.getReportId();
|
||||
String testPlanLoadCaseId = request.getTestPlanLoadCaseId();
|
||||
|
@ -36,6 +36,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -389,65 +390,10 @@ public class TestCaseReviewService {
|
||||
}
|
||||
|
||||
sqlSession.flushStatements();
|
||||
//同步添加关联的接口和测试用例
|
||||
/* if(request.getChecked()){
|
||||
if (!testCaseIds.isEmpty()) {
|
||||
testCaseIds.forEach(caseId -> {
|
||||
TestCaseWithBLOBs testDtail=testCaseMapper.selectByPrimaryKey(caseId);
|
||||
if(StringUtils.equals(testDtail.getType(), TestCaseStatus.performance.name())){
|
||||
TestCaseReviewLoad t=new TestCaseReviewLoad();
|
||||
t.setId(UUID.randomUUID().toString());
|
||||
t.setTestCaseReviewId(request.getReviewId());
|
||||
t.setLoadCaseId(testDtail.getTestId());
|
||||
t.setCreateTime(System.currentTimeMillis());
|
||||
t.setUpdateTime(System.currentTimeMillis());
|
||||
TestCaseReviewLoadExample example=new TestCaseReviewLoadExample();
|
||||
example.createCriteria().andTestCaseReviewIdEqualTo(request.getReviewId()).andLoadCaseIdEqualTo(t.getLoadCaseId());
|
||||
if (testCaseReviewLoadMapper.countByExample(example) <=0) {
|
||||
testCaseReviewLoadMapper.insert(t);
|
||||
}
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
|
||||
}
|
||||
if(StringUtils.equals(testDtail.getType(),TestCaseStatus.testcase.name())){
|
||||
TestCaseReviewApiCase t=new TestCaseReviewApiCase();
|
||||
ApiTestCaseWithBLOBs apitest=apiTestCaseMapper.selectByPrimaryKey(testDtail.getTestId());
|
||||
ApiDefinitionWithBLOBs apidefinition=apiDefinitionMapper.selectByPrimaryKey(apitest.getApiDefinitionId());
|
||||
t.setId(UUID.randomUUID().toString());
|
||||
t.setTestCaseReviewId(request.getReviewId());
|
||||
t.setApiCaseId(testDtail.getTestId());
|
||||
t.setEnvironmentId(apidefinition.getEnvironmentId());
|
||||
t.setCreateTime(System.currentTimeMillis());
|
||||
t.setUpdateTime(System.currentTimeMillis());
|
||||
TestCaseReviewApiCaseExample example=new TestCaseReviewApiCaseExample();
|
||||
example.createCriteria().andTestCaseReviewIdEqualTo(request.getReviewId()).andApiCaseIdEqualTo(t.getApiCaseId());
|
||||
if(testCaseReviewApiCaseMapper.countByExample(example)<=0){
|
||||
testCaseReviewApiCaseMapper.insert(t);
|
||||
}
|
||||
|
||||
}
|
||||
if(StringUtils.equals(testDtail.getType(),TestCaseStatus.automation.name())){
|
||||
TestCaseReviewScenario t=new TestCaseReviewScenario();
|
||||
ApiScenarioWithBLOBs testPlanApiScenario=apiScenarioMapper.selectByPrimaryKey(testDtail.getTestId());
|
||||
t.setId(UUID.randomUUID().toString());
|
||||
t.setTestCaseReviewId(request.getReviewId());
|
||||
t.setApiScenarioId(testDtail.getTestId());
|
||||
t.setLastResult(testPlanApiScenario.getLastResult());
|
||||
t.setPassRate(testPlanApiScenario.getPassRate());
|
||||
t.setReportId(testPlanApiScenario.getReportId());
|
||||
t.setStatus(testPlanApiScenario.getStatus());
|
||||
t.setCreateTime(System.currentTimeMillis());
|
||||
t.setUpdateTime(System.currentTimeMillis());
|
||||
TestCaseReviewScenarioExample example=new TestCaseReviewScenarioExample();
|
||||
example.createCriteria().andTestCaseReviewIdEqualTo(request.getReviewId()).andApiScenarioIdEqualTo(t.getApiScenarioId());
|
||||
if(testCaseReviewScenarioMapper.countByExample(example)<=0){
|
||||
testCaseReviewScenarioMapper.insert(t);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}*/
|
||||
TestCaseReview testCaseReview = testCaseReviewMapper.selectByPrimaryKey(request.getReviewId());
|
||||
if (StringUtils.equals(testCaseReview.getStatus(), TestCaseReviewStatus.Prepare.name())
|
||||
|| StringUtils.equals(testCaseReview.getStatus(), TestCaseReviewStatus.Completed.name())) {
|
||||
|
@ -58,6 +58,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -674,6 +675,9 @@ public class TestCaseService {
|
||||
}
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateImportData(List<TestCaseWithBLOBs> testCases, String projectId) {
|
||||
@ -699,6 +703,9 @@ public class TestCaseService {
|
||||
});
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
private String updateCustomField(String customFields, String priority) {
|
||||
@ -756,6 +763,9 @@ public class TestCaseService {
|
||||
});
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -795,6 +805,9 @@ public class TestCaseService {
|
||||
});
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
public void testCaseTemplateExport(String projectId, String importType, HttpServletResponse response) {
|
||||
|
@ -56,6 +56,7 @@ import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.apache.jorphan.collections.HashTree;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -459,8 +460,11 @@ public class TestPlanApiCaseService {
|
||||
TestPlanReportExecuteCatch.updateTestPlanThreadInfo(request.getPlanReportId(), executeThreadIdMap, null, null);
|
||||
}
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
|
||||
sqlSession.commit();
|
||||
List<String> reportIds = new LinkedList<>();
|
||||
// 开始串行执行
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@ -562,7 +566,10 @@ public class TestPlanApiCaseService {
|
||||
executeThreadIdMap.put(testPlanApiCase.getId(), report.getId());
|
||||
MessageCache.caseExecResourceLock.put(report.getId(), report);
|
||||
});
|
||||
sqlSession.commit();
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
//如果是测试计划生成报告的执行,则更新执行信息、执行线程信息。
|
||||
if (TestPlanReportExecuteCatch.containsReport(request.getPlanReportId())) {
|
||||
if (!executeThreadIdMap.isEmpty()) {
|
||||
@ -677,6 +684,9 @@ public class TestPlanApiCaseService {
|
||||
});
|
||||
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean hasFailCase(String planId, List<String> apiCaseIds) {
|
||||
|
@ -31,6 +31,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -128,6 +129,9 @@ public class TestPlanLoadCaseService {
|
||||
testPlanMapper.updateByPrimaryKey(testPlan);
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
public void delete(String id) {
|
||||
|
@ -31,6 +31,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -247,6 +248,9 @@ public class TestPlanScenarioCaseService {
|
||||
mapper.updateByPrimaryKeyWithBLOBs(testPlanApiScenario);
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -66,6 +66,7 @@ import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.apache.jorphan.collections.HashTree;
|
||||
import org.apache.jorphan.collections.ListedHashTree;
|
||||
import org.mybatis.spring.SqlSessionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@ -668,6 +669,10 @@ public class TestPlanService {
|
||||
testPlan.setActualEndTime(null);
|
||||
testPlanMapper.updateByPrimaryKey(testPlan);
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
|
||||
public List<TestPlan> recentTestPlans(String projectId) {
|
||||
@ -1438,6 +1443,10 @@ public class TestPlanService {
|
||||
}
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user