/**
* This method is reentrant. It can be executed even if some projects are already indexed.
*/
public ResourceIndexerDao indexProjects() {
final DbSession session = mybatis.openSession(true);
try {
final ResourceIndexerMapper mapper = session.getMapper(ResourceIndexerMapper.class);
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 {