Package org.sonar.core.persistence

Examples of org.sonar.core.persistence.DbSession.commit()


            session.commit();
          }
          builtInProfiles.put(language, name);
        }
        setDefault(language, defs, session);
        session.commit();
      }

    } finally {
      session.close();
      profiler.stop();
View Full Code Here


      if (xmlQProfilesByPlugin != null) {
        for (Map.Entry<String, String> entry : xmlQProfilesByPlugin.entrySet()) {
          result.add(exporters.importXml(profile, entry.getKey(), entry.getValue(), dbSession));
        }
      }
      dbSession.commit();
      return result;
    } finally {
      dbSession.close();
    }
  }
View Full Code Here

  public List<ActiveRuleChange> activate(String profileKey, RuleActivation activation) {
    verifyAdminPermission();
    DbSession dbSession = db.openSession(false);
    try {
      List<ActiveRuleChange> changes = ruleActivator.activate(dbSession, activation, profileKey);
      dbSession.commit();
      return changes;
    } finally {
      dbSession.close();
    }
  }
View Full Code Here

      DefaultIssue issue = issueService.getByKeyForUpdate(session, issueKey).toDefaultIssue();
      IssueChangeContext context = IssueChangeContext.createUser(new Date(), userSession.login());
      updater.addComment(issue, text, context);

      issueService.saveIssue(session, issue, context, text);
      session.commit();

      List<DefaultIssueComment> comments = findComments(issueKey);
      if (comments.isEmpty()) {
        throw new BadRequestException(String.format("Fail to add a comment on issue %s", issueKey));
      }
View Full Code Here

      for (RulesDefinition.ExtendedRepository repoDef : getRepositories(context)) {
        if (languages.get(repoDef.language()) != null) {
          for (RulesDefinition.Rule ruleDef : repoDef.rules()) {
            registerRule(ruleDef, allRules, allCharacteristics, session);
          }
          session.commit();
        }
      }
      List<RuleDto> activeRules = processRemainingDbRules(allRules.values(), session);
      removeActiveRulesOnStillExistingRepositories(session, activeRules, context);
      session.commit();
View Full Code Here

          session.commit();
        }
      }
      List<RuleDto> activeRules = processRemainingDbRules(allRules.values(), session);
      removeActiveRulesOnStillExistingRepositories(session, activeRules, context);
      session.commit();

    } finally {
      session.close();
      profiler.stop();
    }
View Full Code Here

        IssueNormalizer.IssueField.PROJECT.field(), projectUuids);
      synchronizeByProject(session, db.issueAuthorizationDao(), index.get(IssueAuthorizationIndex.class),
        IssueAuthorizationNormalizer.IssueAuthorizationField.PROJECT.field(), projectUuids);
      synchronize(session, db.activeRuleDao(), index.get(ActiveRuleIndex.class));
      synchronize(session, db.activityDao(), index.get(ActivityIndex.class));
      session.commit();
      LOG.info("Synchronization done in {}ms...", System.currentTimeMillis() - start);
    } finally {
      session.close();
    }
  }
View Full Code Here

   */
  List<ActiveRuleChange> deactivate(ActiveRuleKey key) {
    DbSession dbSession = db.openSession(false);
    try {
      List<ActiveRuleChange> changes = deactivate(dbSession, key);
      dbSession.commit();
      return changes;
    } finally {
      dbSession.close();
    }
  }
View Full Code Here

          // other exceptions stop the bulk activation
          result.incrementFailed();
          result.getErrors().add(e.errors());
        }
      }
      dbSession.commit();
    } finally {
      dbSession.close();
    }
    return result;
  }
View Full Code Here

          // other exceptions stop the bulk activation
          result.incrementFailed();
          result.getErrors().add(e.errors());
        }
      }
      dbSession.commit();
      return result;
    } finally {
      dbSession.close();
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.