From 2ca7552978f5389ef5ed2e5d4be3cb43e446f7c6 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Mon, 3 Apr 2023 13:25:15 +0100 Subject: Fix Participant primed status in ACM Fix Participant primed status is not updated correctly in the runtime Issue-ID: POLICY-4625 Change-Id: I6a3ce7b73f5edaeedf84ec43c7f62c526cd99f36 Signed-off-by: FrancescoFioraEst --- .../clamp/models/acm/persistence/provider/AcDefinitionProvider.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'models/src/main/java/org/onap') diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProvider.java b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProvider.java index 71f510a67..dc4a6e302 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProvider.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProvider.java @@ -37,6 +37,7 @@ import org.onap.policy.models.base.PfModelRuntimeException; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; import org.springframework.data.domain.Example; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Transactional; @Service @@ -97,6 +98,7 @@ public class AcDefinitionProvider { var jpaAcmDefinition = ProviderUtils.getJpaAndValidate(acDefinition, JpaAutomationCompositionDefinition::new, "AutomationCompositionDefinition"); acmDefinitionRepository.save(jpaAcmDefinition); + acmDefinitionRepository.flush(); } /** @@ -141,7 +143,7 @@ public class AcDefinitionProvider { * @param compositionId The UUID of the automation composition definition to delete * @return the automation composition definition */ - @Transactional(readOnly = true) + @Transactional(readOnly = true, isolation = Isolation.READ_UNCOMMITTED) public Optional findAcDefinition(UUID compositionId) { var jpaGet = acmDefinitionRepository.findById(compositionId.toString()); return jpaGet.stream().map(JpaAutomationCompositionDefinition::toAuthorative).findFirst(); -- cgit 1.2.3-korg