Package org.sonar.core.persistence

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


      resources.add(project);

      // and then proceed with the batch UPDATE at once
      runBatchUpdateForAllResources(resources, projectOldKey, newKey, mapper);

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


        Collection<ResourceDto> resources = Lists.newArrayList(module);
        resources.addAll(allResourcesByModuleMap.get(module));
        runBatchUpdateForAllResources(resources, oldModuleKey, newModuleKey, mapper);
      }

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

        .setRepositoryKey("pmd")
        .setSeverity(2)
        .setStatus(RuleStatus.READY),
      RuleTesting.newManualRule("Manual_Rule").setName("Manual Rule")
    );
    session.commit();
    session.close();
  }

  @After
  public void after() {
View Full Code Here

    try {
      DuplicationMapper mapper = session.getMapper(DuplicationMapper.class);
      for (DuplicationUnitDto unit : units) {
        mapper.batchInsert(unit);
      }
      session.commit();

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

      try {
        UserDto user = session.getMapper(UserMapper.class).selectUserByLogin(login);
        if (user != null) {
          permissionFacade.deleteUserPermission(Long.valueOf(resource.getId()), user.getId(), role, session);
          permissionFacade.insertUserPermission(Long.valueOf(resource.getId()), user.getId(), role, session);
          session.commit();
        }
      } finally {
        MyBatis.closeQuietly(session);
      }
    }
View Full Code Here

    if (resource.getId() != null) {
      DbSession session = myBatis.openSession(false);
      try {
        permissionFacade.deleteGroupPermission(Long.valueOf(resource.getId()), groupName, role, session);
        permissionFacade.insertGroupPermission(Long.valueOf(resource.getId()), groupName, role, session);
        session.commit();
      } finally {
        MyBatis.closeQuietly(session);
      }
    }
  }
View Full Code Here

  @Override
  public void grantDefaultRoles(Resource resource) {
    DbSession session = myBatis.openSession(false);
    try {
      grantDefaultRoles(session, resource);
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
}
View Full Code Here

          Map<Long, String> uuidByComponentId = newHashMap();
          migrateEnabledComponents(readSession, writeSession, project, uuidByComponentId);
          migrateDisabledComponents(readSession, writeSession, project, uuidByComponentId);
        }
      });
      writeSession.commit();
      readSession.commit();

      migrateComponentsWithoutUuid(readSession, writeSession);
      writeSession.commit();
View Full Code Here

      });
      writeSession.commit();
      readSession.commit();

      migrateComponentsWithoutUuid(readSession, writeSession);
      writeSession.commit();

      // log the total number of process rows
      progressTask.log();
    } finally {
      readSession.close();
View Full Code Here

  @Deprecated
  public void insert(QualityProfileDto dto) {
    DbSession session = mybatis.openSession(false);
    try {
      insert(session, dto);
      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.