Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure reactive transaction rollback on commit error #30096

Commits on Mar 9, 2023

  1. Ensure reactive transaction rollback on commit error

    This change fixes a situation where error handling was skipped during
    `processCommit()` in case the `doCommit()` failed. The error handling
    was set up via an `onErrorResume` operator that was nested inside a
    `then(...)`, applied to an inner `Mono.empty()`. As a consequence,
    it would never receive an error signal (effectively decoupling the
    onErrorResume from the main chain).
    
    This change simply moves the error handling back one level up. It also
    simplifies the `doCommit` code a bit by getting rid of the steps that
    artificially introduce a `Mono<Object>` return type, which is not really
    needed.
    
    A pre-existing test was missing the fact that the rollback didn't occur,
    which is now fixed. Another dedicated test is introduced building upon
    the `ReactiveTestTransactionManager` class.
    
    Closes spring-projectsgh-28968
    Closes spring-projectsgh-30096
    simonbasle committed Mar 9, 2023
    Configuration menu
    Copy the full SHA
    c27e297 View commit details
    Browse the repository at this point in the history