Skip to content

Commit ffbecf1

Browse files
committed
Fix Checkstyle violation
1 parent f0f6af2 commit ffbecf1

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionalOperatorImpl.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,13 @@ public ReactiveTransactionManager getTransactionManager() {
7575
public <T> Flux<T> execute(TransactionCallback<T> action) throws TransactionException {
7676
return TransactionContextManager.currentContext().flatMapMany(context -> {
7777
Mono<ReactiveTransaction> status = this.transactionManager.getReactiveTransaction(this.transactionDefinition);
78-
return status.flatMapMany(it -> {
79-
// This is an around advice: Invoke the next interceptor in the chain.
80-
// This will normally result in a target object being invoked.
81-
// Need re-wrapping of ReactiveTransaction until we get hold of the exception
82-
// through usingWhen.
83-
return Flux.usingWhen(Mono.just(it), action::doInTransaction,
84-
this.transactionManager::commit, s -> Mono.empty())
85-
.onErrorResume(ex -> rollbackOnException(it, ex).then(Mono.error(ex)));
86-
});
78+
// This is an around advice: Invoke the next interceptor in the chain.
79+
// This will normally result in a target object being invoked.
80+
// Need re-wrapping of ReactiveTransaction until we get hold of the exception
81+
// through usingWhen.
82+
return status.flatMapMany(it -> Flux.usingWhen(Mono.just(it), action::doInTransaction,
83+
this.transactionManager::commit, s -> Mono.empty())
84+
.onErrorResume(ex -> rollbackOnException(it, ex).then(Mono.error(ex))));
8785
})
8886
.subscriberContext(TransactionContextManager.getOrCreateContext())
8987
.subscriberContext(TransactionContextManager.getOrCreateContextHolder());

0 commit comments

Comments
 (0)