From 62a918c5dae1979e424627c1ed49156c1c059d34 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 9 Mar 2021 16:08:59 +0100 Subject: [PATCH] Fully consume insert response. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R2dbcEntityTemplate.insert(…) now fully consumes the response from the INSERT call before continuing. Previously, we consumed only the first signal and continued then. A driver could emit a row and then an error signal and so the error signal would go unnoticed. Closes #552. --- .../springframework/data/r2dbc/core/R2dbcEntityTemplate.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/data/r2dbc/core/R2dbcEntityTemplate.java b/src/main/java/org/springframework/data/r2dbc/core/R2dbcEntityTemplate.java index 8de49ba..cd47f73 100644 --- a/src/main/java/org/springframework/data/r2dbc/core/R2dbcEntityTemplate.java +++ b/src/main/java/org/springframework/data/r2dbc/core/R2dbcEntityTemplate.java @@ -392,8 +392,7 @@ public class R2dbcEntityTemplate implements R2dbcEntityOperations, BeanFactoryAw .into(persistentEntity.getType()) // .table(tableName).using(entityToInsert) // .map(this.dataAccessStrategy.getConverter().populateIdIfNecessary(entityToInsert)) // - .first() // - .defaultIfEmpty(entityToInsert); + .all().last(entityToInsert); // } @SuppressWarnings("unchecked")