From cb659153a537d14d52eb946407d0c126997eee67 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Tue, 18 Jun 2024 22:49:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E4=B8=AD=E6=AD=A2=E6=97=B6=E7=9A=84=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/service/TestPlanExecuteService.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java index eda67a34df..eca14eaabd 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java @@ -134,7 +134,9 @@ public class TestPlanExecuteService { /** * 单个执行测试计划 + * 这里涉及到嵌套查询,不使用事务。中间涉及到的报告生成、测试计划字段更改、测试报告汇总等操作会开启子事务处理。 */ + @Transactional(rollbackFor = Exception.class, propagation = Propagation.NOT_SUPPORTED) public String singleExecuteTestPlan(TestPlanExecuteRequest request, String userId) { TestPlanExecutionQueue executionQueue = new TestPlanExecutionQueue(); executionQueue.setSourceID(request.getExecuteId()); @@ -165,10 +167,15 @@ public class TestPlanExecuteService { LogUtils.info("测试计划(组)的单独执行start!计划报告[{}] , 资源ID[{}]", singleExecuteRootQueue.getPrepareReportId(), singleExecuteRootQueue.getSourceID()); - return executeTestPlanOrGroup(executionQueue); + String returnId = executeTestPlanOrGroup(executionQueue); + return returnId; } - //批量执行测试计划组 + /** + * 批量执行测试计划 + * 这里涉及到嵌套查询,不使用事务。中间涉及到的报告生成、测试计划字段更改、测试报告汇总等操作会开启子事务处理。 + */ + @Transactional(rollbackFor = Exception.class, propagation = Propagation.NOT_SUPPORTED) public void batchExecuteTestPlan(TestPlanBatchExecuteRequest request, String userId) { List rightfulIds = testPlanService.selectRightfulIds(request.getExecuteIds());