Skip to content

Commit

Permalink
Fully consume insert response.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mp911de committed Mar 9, 2021
1 parent 34d8d10 commit 91ee136
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ private <T> Mono<T> doInsert(T entity, SqlIdentifier tableName, OutboundRow outb
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));
}

Expand Down

0 comments on commit 91ee136

Please sign in to comment.