Package org.sonar.core.persistence

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


  void setParent(String key, @Nullable String parentKey) {
    DbSession dbSession = db.openSession(false);
    try {
      setParent(dbSession, key, parentKey);
      dbSession.commit();

    } finally {
      dbSession.close();
    }
  }
View Full Code Here


      if (!Scopes.PROJECT.equals(project.scope())) {
        throw new IllegalArgumentException("Only project can be deleted");
      }
      purgeDao.deleteResourceTree(project.getId());
      deletePermissionIndexes(dbSession, project.uuid());
      dbSession.commit();

      deleteIssuesFromIndex(project.uuid());
    } finally {
      MyBatis.closeQuietly(dbSession);
    }
View Full Code Here

      }

      boolean needUpdate = updateRule(ruleDto, subCharacteristic, ruleChange.debtRemediationFunction(), ruleChange.debtRemediationCoefficient(), ruleChange.debtRemediationOffset(),
        session);
      if (needUpdate) {
        session.commit();
      }
    } catch (IllegalArgumentException e) {
      throw new BadRequestException(e.getMessage());
    } finally {
      MyBatis.closeQuietly(session);
View Full Code Here

        }

        resetRules(ruleDtos, rules, allCharacteristicDtos, updateDate, session);
      }

      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here

    DbSession session = dbClient.openSession(false);
    try {
      List<CharacteristicDto> allCharacteristicDtos = restoreCharacteristics(characteristicsXMLImporter.importXML(xml), updateDate, session);
      restoreRules(allCharacteristicDtos, rules(languageKey, session), rulesXMLImporter.importXML(xml, validationMessages), validationMessages, updateDate, session);

      session.commit();
    } catch (IllegalArgumentException e) {
      LOG.debug("Error when restoring the model", e);
      validationMessages.addErrorText(e.getMessage());
    } finally {
      MyBatis.closeQuietly(session);
View Full Code Here

      Context context = newContext(update);
      // validate only the changes, not all the rule fields
      apply(update, context, userSession);
      dbClient.ruleDao().update(dbSession, context.rule);
      updateParameters(dbSession, update, context);
      dbSession.commit();
      return true;

    } finally {
      dbSession.close();
    }
View Full Code Here

          if (!requirementsForRule.isEmpty()) {
            convert(rule, requirementsForRule, dbSession);
            requirementCopied++;
          }
        }
        dbSession.commit();

        LOGGER.info("{} requirements have been found, {} have been copied", requirementDtos.size(), requirementCopied);
      }
    } finally {
      MyBatis.closeQuietly(dbSession);
View Full Code Here

  private void removeRequirementsDataFromCharacteristics() {
    DbSession dbSession = dbClient.openSession(false);
    try {
      dbSession.getMapper(CharacteristicMapper.class).deleteRequirementsFromCharacteristicsTable();
      dbSession.commit();
    } finally {
      MyBatis.closeQuietly(dbSession);
    }
  }
View Full Code Here

    DbSession session = dbClient.openSession(false);
    try {
      ComponentDto projectOrModule = getByKey(projectOrModuleKey);
      resourceKeyUpdaterDao.updateKey(projectOrModule.getId(), newKey);
      session.commit();

      previewCache.reportResourceModification(newKey);

      session.commit();
    } finally {
View Full Code Here

      resourceKeyUpdaterDao.updateKey(projectOrModule.getId(), newKey);
      session.commit();

      previewCache.reportResourceModification(newKey);

      session.commit();
    } finally {
      session.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.