From 22c8ebe741fb7ff7c6f18f95c7b74aa0104f4620 Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Wed, 27 Sep 2017 12:59:05 +0200 Subject: [PATCH] Return WS response only after changes are commited --- .../java/org/sonar/server/qualitygate/ws/CreateAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/CreateAction.java b/server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/CreateAction.java index ee8beb022c9..532361c33fc 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/CreateAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/CreateAction.java @@ -24,9 +24,9 @@ import org.sonar.api.server.ws.Response; import org.sonar.api.server.ws.WebService; import org.sonar.db.DbClient; import org.sonar.db.DbSession; +import org.sonar.db.permission.OrganizationPermission; import org.sonar.db.qualitygate.QualityGateDto; import org.sonar.server.organization.DefaultOrganizationProvider; -import org.sonar.db.permission.OrganizationPermission; import org.sonar.server.qualitygate.QualityGateUpdater; import org.sonar.server.user.UserSession; import org.sonarqube.ws.WsQualityGates.CreateWsResponse; @@ -73,8 +73,8 @@ public class CreateAction implements QualityGatesWsAction { CreateWsResponse.Builder createWsResponse = CreateWsResponse.newBuilder() .setId(newQualityGate.getId()) .setName(newQualityGate.getName()); - writeProtobuf(createWsResponse.build(), request, response); dbSession.commit(); + writeProtobuf(createWsResponse.build(), request, response); } } -- 2.39.5