- 
                Notifications
    You must be signed in to change notification settings 
- Fork 38.8k
Closed
Closed
Copy link
Labels
in: dataIssues in data modules (jdbc, orm, oxm, tx)Issues in data modules (jdbc, orm, oxm, tx)type: regressionA bug that is also a regressionA bug that is also a regression
Milestone
Description
In our app, we have several controller methods that construct Mono within JPA transaction and returns it.
Something like:
@PostMapping
@Transactional
fun handle(): Mono<Boolean> {
  val user = findUser()
  val subscription = user.subscriptions[0]
  return emailSender.send(subscription.email, ...)
}Before 5.2, the transaction commits when the method returns, and the returned side effect gets executed without holding a transaction.
With reactive transactions introduced in 5.2, code like this breaks because JpaTransactionManager is not a ReactiveTransactionManager.
Currently there is no way to restore the previous behavior as reactive transaction handling is always active in TransactionAspectSupport. It would be easier to upgrade if there is a way to opt-out from reactive transaction behavior.
Some ideas:
- Globally disable reactive transactions: TransactionAspectSupport#setEnableReactiveTransactions(false)?
- Selectively disable reactive transactions: @Transactional(reactive = false)?
schnapster, ttthao, loezix and dreis2211
Metadata
Metadata
Assignees
Labels
in: dataIssues in data modules (jdbc, orm, oxm, tx)Issues in data modules (jdbc, orm, oxm, tx)type: regressionA bug that is also a regressionA bug that is also a regression