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:
@@ -568,8 +568,8 @@ public class R2dbcEntityTemplate implements R2dbcEntityOperations, BeanFactoryAw
|
||||
return this.databaseClient.sql(operation) //
|
||||
.filter(statement -> statement.returnGeneratedValues())
|
||||
.map(this.dataAccessStrategy.getConverter().populateIdIfNecessary(entity)) //
|
||||
.first() //
|
||||
.defaultIfEmpty(entity) //
|
||||
.all() //
|
||||
.last(entity)
|
||||
.flatMap(saved -> maybeCallAfterSave(saved, outboundRow, tableName));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user