From 6e56ac9a060a27f20a3441c0930f20d4ad88fa4e Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Tue, 6 Sep 2016 10:21:52 +0200 Subject: [PATCH] SONAR-7675 InternalPropertiesImpl must commit --- .../java/org/sonar/server/property/InternalPropertiesImpl.java | 1 + .../org/sonar/server/property/InternalPropertiesImplTest.java | 3 +++ 2 files changed, 4 insertions(+) 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() { -- 2.39.5