aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2019-06-10 15:48:47 +0200
committerSonarTech <sonartech@sonarsource.com>2019-06-13 20:21:12 +0200
commit2f48b3196168af75ebe269ad8d9e913bad2437b8 (patch)
tree56549d54813150270cd02f3a09e944ee25bd7735 /server/sonar-db-dao
parentc1e973762772c0ecfc56e921d44ff3f495fe6fcd (diff)
downloadsonarqube-2f48b3196168af75ebe269ad8d9e913bad2437b8.tar.gz
sonarqube-2f48b3196168af75ebe269ad8d9e913bad2437b8.zip
SONAR-12146 fix resilience of deletion of project/branch/view
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java
index d765b932def..1f0c55ff2b0 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java
@@ -245,28 +245,28 @@ public class PurgeDao implements Dao {
deleteRootComponent(uuid, purgeMapper, purgeCommands);
}
- private void deleteRootComponent(String rootUuid, PurgeMapper mapper, PurgeCommands commands) {
+ private static void deleteRootComponent(String rootUuid, PurgeMapper mapper, PurgeCommands commands) {
List<IdUuidPair> rootAndModulesOrSubviews = mapper.selectRootAndModulesOrSubviewsByProjectUuid(rootUuid);
long rootId = rootAndModulesOrSubviews.stream()
.filter(pair -> pair.getUuid().equals(rootUuid))
.map(IdUuidPair::getId)
.findFirst()
.orElseThrow(() -> new IllegalArgumentException("Couldn't find root component with uuid " + rootUuid));
- commands.deletePermissions(rootId);
commands.deleteLinks(rootUuid);
commands.deleteAnalyses(rootUuid);
commands.deleteByRootAndModulesOrSubviews(rootAndModulesOrSubviews);
- commands.deleteComponents(rootUuid);
commands.deleteIssues(rootUuid);
commands.deleteFileSources(rootUuid);
commands.deleteCeActivity(rootUuid);
commands.deleteCeQueue(rootUuid);
commands.deleteWebhooks(rootUuid);
commands.deleteWebhookDeliveries(rootUuid);
+ commands.deleteLiveMeasures(rootUuid);
commands.deleteProjectMappings(rootUuid);
commands.deleteProjectAlmBindings(rootUuid);
+ commands.deletePermissions(rootId);
commands.deleteBranch(rootUuid);
- commands.deleteLiveMeasures(rootUuid);
+ commands.deleteComponents(rootUuid);
}
/**