From dc1ff79026c9b7841ff27a10ab16bc8284de8b98 Mon Sep 17 00:00:00 2001 From: Davide D'Alto Date: Fri, 26 Sep 2025 11:54:19 +0200 Subject: [PATCH] [#2535] Fix operations order in BatchingConnection --- .../java/org/hibernate/reactive/pool/BatchingConnection.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/pool/BatchingConnection.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/pool/BatchingConnection.java index 5e5a96fc9..3114071ca 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/pool/BatchingConnection.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/pool/BatchingConnection.java @@ -106,9 +106,8 @@ public CompletionStage update( return voidFuture(); } else { - CompletionStage lastBatch = executeBatch(); - newBatch( sql, paramValues, expectation ); - return lastBatch; + return executeBatch() + .thenAccept( v -> newBatch( sql, paramValues, expectation ) ); } } }