Package org.sonar.core.persistence

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


      .setActiveRuleId(1)
      .setRulesParameterId(1)
      .setKey("max")
      .setValue("20");
    dao.insert(dto, session);
    session.commit();
    session.close();

    checkTables("insert_parameter", "active_rule_parameters");
  }
View Full Code Here


  public void save(Iterable<DefaultIssue> issues) {
    DbSession session = mybatis.openSession(true);
    try {
      save(session, issues);
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here

        IssueChangeMapper issueChangeMapper = session.getMapper(IssueChangeMapper.class);
        for (DefaultIssue issue : toBeUpdated) {
          doUpdate(session, now, issue);
          insertChanges(issueChangeMapper, issue);
        }
        session.commit();
      } finally {
        MyBatis.closeQuietly(session);
      }
    }
  }
View Full Code Here

  public boolean delete(String key) {
    DbSession session = mybatis.openSession(false);
    try {
      IssueChangeMapper mapper = session.getMapper(IssueChangeMapper.class);
      int count = mapper.delete(key);
      session.commit();
      return count == 1;

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

  public boolean update(IssueChangeDto change) {
    DbSession session = mybatis.openSession(false);
    try {
      IssueChangeMapper mapper = session.getMapper(IssueChangeMapper.class);
      int count = mapper.update(change);
      session.commit();
      return count == 1;

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

   */
  public ResourceIndexerDao indexProject(final int rootProjectId) {
    DbSession session = mybatis.openSession(true);
    try {
      indexProject(rootProjectId, session);
      session.commit();
      return this;

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

      session.select("org.sonar.core.resource.ResourceIndexerMapper.selectRootProjectIds", /* workaround to get booleans */ResourceIndexerQuery.create(), new ResultHandler() {
        @Override
        public void handleResult(ResultContext context) {
          Integer rootProjectId = (Integer) context.getResultObject();
          doIndexProject(rootProjectId, session, mapper);
          session.commit();
        }
      });
      return this;

    } finally {
View Full Code Here

  public PurgeDao purge(PurgeConfiguration conf) {
    DbSession session = mybatis.openSession(true);
    try {
      purge(session, conf);
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
    return this;
  }
View Full Code Here

    DbSession session = mybatis.openSession(true);
    try {
      for (NotificationQueueDto dto : dtos) {
        session.getMapper(NotificationQueueMapper.class).insert(dto);
      }
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here

    DbSession session = mybatis.openSession(true);
    try {
      for (NotificationQueueDto dto : dtos) {
        session.getMapper(NotificationQueueMapper.class).delete(dto.getId());
      }
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
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.