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
This commit is contained in:
Juergen Hoeller 2009-09-22 13:31:56 +00:00
parent 3c9fa8931d
commit 74b4dfc2bf
1 changed files with 13 additions and 17 deletions

View File

@ -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.
*
* <p>This enables the underlying Spring transaction infrastructure to be used
* easily to implement an aspect for any aspect system.
* <p>This enables the underlying Spring transaction infrastructure to be used easily
* to implement an aspect for any aspect system.
*
* <p>Subclasses are responsible for calling methods in this class in the
* correct order.
* <p>Subclasses are responsible for calling methods in this class in the correct order.
*
* <p>If no transaction name has been specified in the
* <code>TransactionAttribute</code>, the exposed name will be the
* <code>fully-qualified class name + "." + method name</code>
* <p>If no transaction name has been specified in the <code>TransactionAttribute</code>,
* the exposed name will be the <code>fully-qualified class name + "." + method name</code>
* (by default).
*
* <p>Uses the <b>Strategy</b> design pattern. A
* <code>PlatformTransactionManager</code> implementation will perform the
* actual transaction management, and a <code>TransactionAttributeSource</code>
* is used for determining transaction definitions.
* <p>Uses the <b>Strategy</b> design pattern. A <code>PlatformTransactionManager</code>
* implementation will perform the actual transaction management, and a
* <code>TransactionAttributeSource</code> is used for determining transaction definitions.
*
* <p>A transaction aspect is serializable if it's
* <code>PlatformTransactionManager</code> and
* <code>TransactionAttributeSource</code> are serializable.
* <p>A transaction aspect is serializable if its <code>PlatformTransactionManager</code>
* and <code>TransactionAttributeSource</code> 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;