Affects: 5.2.8-RELEASE


It seem that if there are an exception throw by a TransactionSynchronization.beforeCommit the transaction is not rollbacked. - If the reactive method return a Publisher the transaction is commit - If the reactive method return a Mono a rollback is perform but it failed with this error org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction

I have read the AbstractReactiveTransactionManager.java and it seem that there are no exception managed on the beforeCommit call.

https://github.com/spring-projects/spring-framework/blob/4982b5fcb9a2ca49edda697918557bdb76e3d282/spring-tx/src/main/java/org/springframework/transaction/reactive/AbstractReactiveTransactionManager.java#L437-L449

It's strange that the onErrorResume is called on a Mono.empty() instead of the result of the multiple .then()

Waiting a better solution, I manage the error on my beforeCommit method, and rollback in case of exception

Comment From: rstoyanchev

Can you check with 5.3? The behavior changed in 5.3 with #25256.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.