Open rathoreamrsingh opened 6 days ago
I can appreciate the confusion here: We might expect the Statement.execute() Publisher to emit onError when that statement fails. This is actually not what the Publisher is specified to do. The Publisher is specified to emit Result objects, and a Result may represent a database error.
For a batch update statement, you can add an operator which maps each Result to the count of rows updated by each set of bind values in your batch:
Flux.from(statement.execute())
.flatMap(Result::getRowsUpdated)
The getRowsUpdated method will return a Publisher that emits the error to onError.
Hope this helps. Please let me know.
Steps to reproduce:
This results in OracleResultImpl$BatchUpdateErrorResult which comes under doOnNext rather than doOnError.
The expectation is error should be in error stream doOnError but it is coming as data in doOnNext stream.
Please suggest how to resolve this issue or can be caught in proper manner.