From 74b4dfc2bfdab38c1682bad97d2899e3f70bee17 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 22 Sep 2009 13:31:56 +0000 Subject: [PATCH] skip processing when no PlatformTransactionManager found (SPR-3955) git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1959 50f2f4bb-b051-0410-bef5-90022cba6387 --- .../interceptor/TransactionAspectSupport.java | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java b/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java index bbe27688e2e..abb75ef452d 100644 --- a/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java +++ b/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java @@ -43,28 +43,24 @@ import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; /** - * Base class for transactional aspects, such as the AOP Alliance - * {@link TransactionInterceptor} or an AspectJ aspect. + * Base class for transactional aspects, such as the {@link TransactionInterceptor} + * or an AspectJ aspect. * - *

This enables the underlying Spring transaction infrastructure to be used - * easily to implement an aspect for any aspect system. + *

This enables the underlying Spring transaction infrastructure to be used easily + * to implement an aspect for any aspect system. * - *

Subclasses are responsible for calling methods in this class in the - * correct order. + *

Subclasses are responsible for calling methods in this class in the correct order. * - *

If no transaction name has been specified in the - * TransactionAttribute, the exposed name will be the - * fully-qualified class name + "." + method name + *

If no transaction name has been specified in the TransactionAttribute, + * the exposed name will be the fully-qualified class name + "." + method name * (by default). * - *

Uses the Strategy design pattern. A - * PlatformTransactionManager implementation will perform the - * actual transaction management, and a TransactionAttributeSource - * is used for determining transaction definitions. + *

Uses the Strategy design pattern. A PlatformTransactionManager + * implementation will perform the actual transaction management, and a + * TransactionAttributeSource is used for determining transaction definitions. * - *

A transaction aspect is serializable if it's - * PlatformTransactionManager and - * TransactionAttributeSource are serializable. + *

A transaction aspect is serializable if its PlatformTransactionManager + * and TransactionAttributeSource are serializable. * * @author Rod Johnson * @author Juergen Hoeller @@ -234,7 +230,7 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init * Determine the specific transaction manager to use for the given transaction. */ protected PlatformTransactionManager determineTransactionManager(TransactionAttribute txAttr) { - if (this.transactionManager != null) { + if (this.transactionManager != null || this.beanFactory == null) { return this.transactionManager; } PlatformTransactionManager chosen = null;