Clear synchronization before triggering afterCompletion callbacks
Issue: SPR-15194 Issue: SPR-11590
This commit is contained in:
@@ -934,6 +934,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
||||
private void triggerAfterCompletion(DefaultTransactionStatus status, int completionStatus) {
|
||||
if (status.isNewSynchronization()) {
|
||||
List<TransactionSynchronization> synchronizations = TransactionSynchronizationManager.getSynchronizations();
|
||||
TransactionSynchronizationManager.clearSynchronization();
|
||||
if (!status.hasTransaction() || status.isNewTransaction()) {
|
||||
if (status.isDebug()) {
|
||||
logger.trace("Triggering afterCompletion synchronization");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -461,11 +461,11 @@ public abstract class TransactionSynchronizationManager {
|
||||
* @see #setActualTransactionActive
|
||||
*/
|
||||
public static void clear() {
|
||||
clearSynchronization();
|
||||
setCurrentTransactionName(null);
|
||||
setCurrentTransactionReadOnly(false);
|
||||
setCurrentTransactionIsolationLevel(null);
|
||||
setActualTransactionActive(false);
|
||||
synchronizations.remove();
|
||||
currentTransactionName.remove();
|
||||
currentTransactionReadOnly.remove();;
|
||||
currentTransactionIsolationLevel.remove();;
|
||||
actualTransactionActive.remove();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user