You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there I would say your extra parameter for the asyncError was wrong because it should perform the rollback if an exception occurs at transaction.insertRows
From the other side if an error occurs at commit - rollback will not be called and will be passed to a subscriber
Flux.usingWhen(
Transaction.beginTransaction(),
transaction -> transaction.insertRows(Flux.just("A", "B")),
transaction -> transaction.commit().onErrorResume(ex -> transaction.rollback().then(Mono.error(ex))), // this approach is able to catch an error inside the commit block. PS
(transaction, throwable) -> transaction.rollback(), // rollback on error
Transaction::rollback
)
I would be happy to look at some shorter forms for tx::commit but for now I don't know how to catch an error for commit block in some pretty way.
Hands-On-Reactive-Programming-in-Spring-5/chapter-04/src/test/java/org/rpis5/chapters/chapter_04/ReactorEssentialsTest.java
Line 420 in 915dd98
UsingWhen factory method declaration got changed in reactor-core 3.4.17. Source needs to update with
The text was updated successfully, but these errors were encountered: