Skip to content

Commit 62a918c

Browse files
committed
Fully consume insert response.
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.
1 parent 89f126e commit 62a918c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/org/springframework/data/r2dbc/core/R2dbcEntityTemplate.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,7 @@ <T> Mono<T> doInsert(T entity, SqlIdentifier tableName) {
392392
.into(persistentEntity.getType()) //
393393
.table(tableName).using(entityToInsert) //
394394
.map(this.dataAccessStrategy.getConverter().populateIdIfNecessary(entityToInsert)) //
395-
.first() //
396-
.defaultIfEmpty(entityToInsert);
395+
.all().last(entityToInsert); //
397396
}
398397

399398
@SuppressWarnings("unchecked")

0 commit comments

Comments
 (0)