From: Simon Brandhof Date: Mon, 24 Mar 2014 17:48:38 +0000 (+0100) Subject: Fix loading of rules during registration of Q profiles (MySQL only ?) X-Git-Tag: 4.3~293 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a5cc57dbbef2b1b31c531b734579c18829851582;p=sonarqube.git Fix loading of rules during registration of Q profiles (MySQL only ?) --- diff --git a/sonar-server/src/main/java/org/sonar/server/startup/RegisterNewProfiles.java b/sonar-server/src/main/java/org/sonar/server/startup/RegisterNewProfiles.java index 6e9d7ed3681..dca04a3dcaa 100644 --- a/sonar-server/src/main/java/org/sonar/server/startup/RegisterNewProfiles.java +++ b/sonar-server/src/main/java/org/sonar/server/startup/RegisterNewProfiles.java @@ -83,6 +83,10 @@ public class RegisterNewProfiles { public void start() { TimeProfiler profiler = new TimeProfiler(LOGGER).start("Register Quality Profiles"); session = sessionFactory.getSession(); + + // hibernate session can contain an invalid cache of rules + session.getEntityManager().clear(); + ListMultimap profilesByLanguage = loadDefinitions(); for (String language : profilesByLanguage.keySet()) { List profiles = profilesByLanguage.get(language);