From fa1205293abe754e079018aee908356947ca1ad6 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> Date: Mon, 6 May 2024 10:48:17 +0200 Subject: [PATCH] [JBPM-10228] Fixing wrong flush call (#2413) --- .../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 8d85d02d9f..80090ded5a 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 @@ -121,8 +121,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;