From 4bc76a45c779f620869b58e7af9d129979e620fc Mon Sep 17 00:00:00 2001 From: Daniel Schwarz Date: Wed, 22 Feb 2017 11:58:00 +0100 Subject: [PATCH] SONAR-8831 increase performance of bulk issue storage --- .../src/main/java/org/sonar/server/issue/IssueStorage.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueStorage.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueStorage.java index 199d8a6d673..1aacf9eb27c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueStorage.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueStorage.java @@ -100,10 +100,11 @@ public abstract class IssueStorage { if (issue.isNew()) { doInsert(session, now, issue); insertChanges(issueChangeMapper, issue); + count++; if (count > BatchSession.MAX_BATCH_SIZE) { session.commit(); + count = 0; } - count++; } else if (issue.isChanged()) { toBeUpdated.add(issue); } -- 2.39.5