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.
This commit is contained in:
Mark Paluch
2021-03-09 16:08:59 +01:00
parent 89f126eb47
commit 62a918c5da

View File

@@ -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")