]> source.dussan.org Git - sonarqube.git/commitdiff
Fix loading of rules during registration of Q profiles (MySQL only ?)
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 24 Mar 2014 17:48:38 +0000 (18:48 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 24 Mar 2014 17:48:48 +0000 (18:48 +0100)
sonar-server/src/main/java/org/sonar/server/startup/RegisterNewProfiles.java

index 6e9d7ed368186929f0fe21e93cb9148bd90969a9..dca04a3dcaa0869f8a2d83031743c55cb2090f36 100644 (file)
@@ -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<String, RulesProfile> profilesByLanguage = loadDefinitions();
     for (String language : profilesByLanguage.keySet()) {
       List<RulesProfile> profiles = profilesByLanguage.get(language);