Do not retain cache transaction managers
Previously, cache transaction managers may be retained outside the boundaries of an application context with AspectJ since an aspect is basically a singleton for the current class loader. This commit adds a "clearTransactionManagerCache" that is similar to the "clearMetadataCache" introduced in CacheAspectSupport: whenever the context is disposed, the cache is cleared to remove any reference to a transaction manager defined by that context. Issue: SPR-12518
This commit is contained in:
@@ -338,6 +338,13 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the cached transaction managers.
|
||||
*/
|
||||
protected void clearTransactionManagerCache() {
|
||||
this.transactionManagerCache.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the specific transaction manager to use for the given transaction.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user