|
18 | 18 |
|
19 | 19 | import java.lang.reflect.Method;
|
20 | 20 | import java.util.Properties;
|
| 21 | +import java.util.concurrent.ConcurrentHashMap; |
21 | 22 | import java.util.concurrent.ConcurrentMap;
|
22 | 23 |
|
23 | 24 | import org.apache.commons.logging.Log;
|
|
34 | 35 | import org.springframework.transaction.TransactionSystemException;
|
35 | 36 | import org.springframework.transaction.support.CallbackPreferringPlatformTransactionManager;
|
36 | 37 | import org.springframework.transaction.support.TransactionCallback;
|
37 |
| -import org.springframework.util.ConcurrentReferenceHashMap; |
38 | 38 | import org.springframework.util.StringUtils;
|
39 | 39 |
|
40 | 40 | /**
|
@@ -133,7 +133,7 @@ public static TransactionStatus currentTransactionStatus() throws NoTransactionE
|
133 | 133 | private BeanFactory beanFactory;
|
134 | 134 |
|
135 | 135 | private final ConcurrentMap<Object, PlatformTransactionManager> transactionManagerCache =
|
136 |
| - new ConcurrentReferenceHashMap<Object, PlatformTransactionManager>(4); |
| 136 | + new ConcurrentHashMap<Object, PlatformTransactionManager>(4); |
137 | 137 |
|
138 | 138 |
|
139 | 139 | /**
|
@@ -242,9 +242,10 @@ protected final BeanFactory getBeanFactory() {
|
242 | 242 | public void afterPropertiesSet() {
|
243 | 243 | if (getTransactionManager() == null && this.beanFactory == null) {
|
244 | 244 | throw new IllegalStateException(
|
245 |
| - "Setting the property 'transactionManager' or running in a BeanFactory is required"); |
| 245 | + "Set the 'transactionManager' property or make sure to run within a BeanFactory " + |
| 246 | + "containing a PlatformTransactionManager bean!"); |
246 | 247 | }
|
247 |
| - if (this.transactionAttributeSource == null) { |
| 248 | + if (getTransactionAttributeSource() == null) { |
248 | 249 | throw new IllegalStateException(
|
249 | 250 | "Either 'transactionAttributeSource' or 'transactionAttributes' is required: " +
|
250 | 251 | "If there are no transactional methods, then don't use a transaction aspect.");
|
@@ -567,6 +568,7 @@ protected final class TransactionInfo {
|
567 | 568 |
|
568 | 569 | public TransactionInfo(PlatformTransactionManager transactionManager,
|
569 | 570 | TransactionAttribute transactionAttribute, String joinpointIdentification) {
|
| 571 | + |
570 | 572 | this.transactionManager = transactionManager;
|
571 | 573 | this.transactionAttribute = transactionAttribute;
|
572 | 574 | this.joinpointIdentification = joinpointIdentification;
|
|
0 commit comments