@ -352,23 +352,12 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
if ( this . beanFactory ! = null ) {
if ( this . beanFactory ! = null ) {
String qualifier = txAttr ! = null ? txAttr . getQualifier ( ) : null ;
String qualifier = txAttr ! = null ? txAttr . getQualifier ( ) : null ;
if ( StringUtils . hasText ( qualifier ) ) {
if ( StringUtils . hasText ( qualifier ) ) {
PlatformTransactionManager txManager = this . transactionManagerCache . get ( qualifier ) ;
return determineQualifiedTransactionManager ( qualifier ) ;
if ( txManager = = null ) {
txManager = BeanFactoryAnnotationUtils . qualifiedBeanOfType (
this . beanFactory , PlatformTransactionManager . class , qualifier ) ;
this . transactionManagerCache . putIfAbsent ( qualifier , txManager ) ;
}
return txManager ;
}
}
else if ( StringUtils . hasText ( this . transactionManagerBeanName ) ) {
else if ( StringUtils . hasText ( this . transactionManagerBeanName ) ) {
PlatformTransactionManager txManager = this . transactionManagerCache . get ( this . transactionManagerBeanName ) ;
return determineQualifiedTransactionManager ( this . transactionManagerBeanName ) ;
if ( txManager = = null ) {
txManager = this . beanFactory . getBean (
this . transactionManagerBeanName , PlatformTransactionManager . class ) ;
this . transactionManagerCache . putIfAbsent ( this . transactionManagerBeanName , txManager ) ;
}
}
return txManager ;
else if ( txAttr ! = null ) { // Do not lookup default bean name if no tx attributes are set
} else {
PlatformTransactionManager defaultTransactionManager = getTransactionManager ( ) ;
PlatformTransactionManager defaultTransactionManager = getTransactionManager ( ) ;
if ( defaultTransactionManager = = null ) {
if ( defaultTransactionManager = = null ) {
defaultTransactionManager = this . beanFactory . getBean ( PlatformTransactionManager . class ) ;
defaultTransactionManager = this . beanFactory . getBean ( PlatformTransactionManager . class ) ;
@ -381,6 +370,16 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
return getTransactionManager ( ) ;
return getTransactionManager ( ) ;
}
}
private PlatformTransactionManager determineQualifiedTransactionManager ( String qualifier ) {
PlatformTransactionManager txManager = this . transactionManagerCache . get ( qualifier ) ;
if ( txManager = = null ) {
txManager = BeanFactoryAnnotationUtils . qualifiedBeanOfType (
this . beanFactory , PlatformTransactionManager . class , qualifier ) ;
this . transactionManagerCache . putIfAbsent ( qualifier , txManager ) ;
}
return txManager ;
}
/ * *
/ * *
* Convenience method to return a String representation of this Method
* Convenience method to return a String representation of this Method
* for use in logging . Can be overridden in subclasses to provide a
* for use in logging . Can be overridden in subclasses to provide a