Browse Source

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
pull/1/head
Juergen Hoeller 17 years ago
parent
commit
74b4dfc2bf
  1. 30
      org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java

30
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; import org.springframework.util.StringUtils;
/** /**
* Base class for transactional aspects, such as the AOP Alliance * Base class for transactional aspects, such as the {@link TransactionInterceptor}
* {@link TransactionInterceptor} or an AspectJ aspect. * or an AspectJ aspect.
* *
* <p>This enables the underlying Spring transaction infrastructure to be used * <p>This enables the underlying Spring transaction infrastructure to be used easily
* easily to implement an aspect for any aspect system. * to implement an aspect for any aspect system.
* *
* <p>Subclasses are responsible for calling methods in this class in the * <p>Subclasses are responsible for calling methods in this class in the correct order.
* correct order.
* *
* <p>If no transaction name has been specified in the * <p>If no transaction name has been specified in the <code>TransactionAttribute</code>,
* <code>TransactionAttribute</code>, the exposed name will be the * the exposed name will be the <code>fully-qualified class name + "." + method name</code>
* <code>fully-qualified class name + "." + method name</code>
* (by default). * (by default).
* *
* <p>Uses the <b>Strategy</b> design pattern. A * <p>Uses the <b>Strategy</b> design pattern. A <code>PlatformTransactionManager</code>
* <code>PlatformTransactionManager</code> implementation will perform the * implementation will perform the actual transaction management, and a
* actual transaction management, and a <code>TransactionAttributeSource</code> * <code>TransactionAttributeSource</code> is used for determining transaction definitions.
* is used for determining transaction definitions.
* *
* <p>A transaction aspect is serializable if it's * <p>A transaction aspect is serializable if its <code>PlatformTransactionManager</code>
* <code>PlatformTransactionManager</code> and * and <code>TransactionAttributeSource</code> are serializable.
* <code>TransactionAttributeSource</code> are serializable.
* *
* @author Rod Johnson * @author Rod Johnson
* @author Juergen Hoeller * @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. * Determine the specific transaction manager to use for the given transaction.
*/ */
protected PlatformTransactionManager determineTransactionManager(TransactionAttribute txAttr) { protected PlatformTransactionManager determineTransactionManager(TransactionAttribute txAttr) {
if (this.transactionManager != null) { if (this.transactionManager != null || this.beanFactory == null) {
return this.transactionManager; return this.transactionManager;
} }
PlatformTransactionManager chosen = null; PlatformTransactionManager chosen = null;

Loading…
Cancel
Save