From 60ece58db73f6d315548b112afd4246a38c734e3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:25:59 +0200 Subject: [PATCH] [JBPM-10228] Fixing wrong flush call (#2413) (#2415) Co-authored-by: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> --- .../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;