From 7120e1eb5cd3e6df198e9f5b2c183e765e8893cc 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 ce7ee013d..557ec944b 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 @@ -104,9 +104,8 @@ public CompletionStage update( return voidFuture(); } else { - CompletionStage lastBatch = executeBatch(); - newBatch( sql, paramValues, expectation ); - return lastBatch; + return executeBatch() + .thenAccept( v -> newBatch( sql, paramValues, expectation ) ); } } }