]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-11882 error if >1000 Permission Templates on Oracle
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Sun, 14 Apr 2019 09:16:09 +0000 (11:16 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 15 Apr 2019 15:18:33 +0000 (17:18 +0200)
server/sonar-db-dao/src/main/java/org/sonar/db/permission/template/PermissionTemplateCharacteristicDao.java

index a05b4640f56aec4e58f3be3f17fc5e3062086335..23593047b5335f1fbddfb185f0480920fbdb2e9e 100644 (file)
@@ -25,13 +25,13 @@ import org.sonar.db.Dao;
 import org.sonar.db.DbSession;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static java.util.Collections.emptyList;
 import static java.util.Objects.requireNonNull;
+import static org.sonar.db.DatabaseUtils.executeLargeInputs;
 
 public class PermissionTemplateCharacteristicDao implements Dao {
 
   public List<PermissionTemplateCharacteristicDto> selectByTemplateIds(DbSession dbSession, List<Long> templateIds) {
-    return templateIds.isEmpty() ? emptyList() : mapper(dbSession).selectByTemplateIds(templateIds);
+    return executeLargeInputs(templateIds, partitionOfTemplateIds -> mapper(dbSession).selectByTemplateIds(partitionOfTemplateIds));
   }
 
   public Optional<PermissionTemplateCharacteristicDto> selectByPermissionAndTemplateId(DbSession dbSession, String permission, long templateId) {