From: Sébastien Lesaint Date: Tue, 6 Sep 2016 08:21:52 +0000 (+0200) Subject: SONAR-7675 InternalPropertiesImpl must commit X-Git-Tag: 6.1-RC1~204 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6e56ac9a060a27f20a3441c0930f20d4ad88fa4e;p=sonarqube.git SONAR-7675 InternalPropertiesImpl must commit --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/property/InternalPropertiesImpl.java b/server/sonar-server/src/main/java/org/sonar/server/property/InternalPropertiesImpl.java index f99002d9dee..3881c0949df 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/property/InternalPropertiesImpl.java +++ b/server/sonar-server/src/main/java/org/sonar/server/property/InternalPropertiesImpl.java @@ -55,6 +55,7 @@ public class InternalPropertiesImpl implements InternalProperties { } else { dbClient.internalPropertiesDao().save(dbSession, propertyKey, value); } + dbSession.commit(); } } diff --git a/server/sonar-server/src/test/java/org/sonar/server/property/InternalPropertiesImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/property/InternalPropertiesImplTest.java index 20c371ba256..7abec84773e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/property/InternalPropertiesImplTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/property/InternalPropertiesImplTest.java @@ -94,6 +94,7 @@ public class InternalPropertiesImplTest { underTest.write(SOME_KEY, null); verify(internalPropertiesDao).saveAsEmpty(dbSession, SOME_KEY); + verify(dbSession).commit(); } @Test @@ -101,6 +102,7 @@ public class InternalPropertiesImplTest { underTest.write(SOME_KEY, EMPTY_STRING); verify(internalPropertiesDao).saveAsEmpty(dbSession, SOME_KEY); + verify(dbSession).commit(); } @Test @@ -108,6 +110,7 @@ public class InternalPropertiesImplTest { underTest.write(SOME_KEY, SOME_VALUE); verify(internalPropertiesDao).save(dbSession, SOME_KEY, SOME_VALUE); + verify(dbSession).commit(); } private void expectKeyNullOrEmptyIAE() {