From d34e86c054f102a7caf4e6ee416b728b28fdff36 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti Date: Fri, 3 May 2024 17:25:15 +0200 Subject: [PATCH] [JBPM-10228] Fixing wrong flush call --- .../java/org/jbpm/persistence/JpaProcessPersistenceContext.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jbpm-persistence/jbpm-persistence-jpa/src/main/java/org/jbpm/persistence/JpaProcessPersistenceContext.java b/jbpm-persistence/jbpm-persistence-jpa/src/main/java/org/jbpm/persistence/JpaProcessPersistenceContext.java index f44390229e..b824790072 100644 --- a/jbpm-persistence/jbpm-persistence-jpa/src/main/java/org/jbpm/persistence/JpaProcessPersistenceContext.java +++ b/jbpm-persistence/jbpm-persistence-jpa/src/main/java/org/jbpm/persistence/JpaProcessPersistenceContext.java @@ -126,8 +126,8 @@ public PersistentCorrelationKey persist(PersistentCorrelationKey correlationKeyI try { EntityManager em = getEntityManager(); em.persist(correlationKeyInfo); - em.flush(); if (this.pessimisticLocking) { + em.flush(); return em.find(CorrelationKeyInfo.class, correlationKeyInfo.getId(), this.lockMode); } return correlationKeyInfo;