Fix doCleanupAfterCompletion invocation

doCleanupAfterCompletion gets now subscribed to when processing
cleanup after a new transaction.
This commit is contained in:
Mark Paluch
2019-05-03 14:52:55 +02:00
committed by Juergen Hoeller
parent ec8689d1fc
commit 9cff07ce35
3 changed files with 26 additions and 3 deletions

View File

@@ -676,17 +676,18 @@ public abstract class AbstractReactiveTransactionManager implements ReactiveTran
if (status.isNewSynchronization()) {
synchronizationManager.clear();
}
Mono<Void> cleanup = Mono.empty();
if (status.isNewTransaction()) {
doCleanupAfterCompletion(synchronizationManager, status.getTransaction());
cleanup = doCleanupAfterCompletion(synchronizationManager, status.getTransaction());
}
if (status.getSuspendedResources() != null) {
if (status.isDebug()) {
logger.debug("Resuming suspended transaction after completion of inner transaction");
}
Object transaction = (status.hasTransaction() ? status.getTransaction() : null);
return resume(synchronizationManager, transaction, (SuspendedResourcesHolder) status.getSuspendedResources());
return cleanup.then(resume(synchronizationManager, transaction, (SuspendedResourcesHolder) status.getSuspendedResources()));
}
return Mono.empty();
return cleanup;
});
}