Skip to content

Commit

Permalink
DATACMNS-82 - Removed transaction manager bean configuration.
Browse files Browse the repository at this point in the history
Always setting a transaction manager breaks repository factories that do not expose a transactionManager property. Thus it's now the responsibility of the concrete BeanDefinitionParser to parse transaction manager configuration.
  • Loading branch information
odrotbohm committed Sep 30, 2011
1 parent fb9fb5e commit 6258d05
Showing 1 changed file with 4 additions and 13 deletions.
Expand Up @@ -46,7 +46,6 @@
import org.springframework.core.type.filter.RegexPatternTypeFilter;
import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.repository.RepositoryDefinition;
import org.springframework.util.StringUtils;
import org.w3c.dom.Element;

/**
Expand All @@ -61,16 +60,12 @@ public abstract class AbstractRepositoryConfigDefinitionParser<S extends GlobalR

private static final Log LOG = LogFactory.getLog(AbstractRepositoryConfigDefinitionParser.class);

private static final String REPOSITORY_INTERFACE_POST_PROCESSOR = "org.springframework.data.repository.core.support.RepositoryInterfaceAwareBeanPostProcessor";
private static final String DEFAULT_TRANSACTION_MANAGER_BEAN_NAME = "transactionManager";
private static final String REPOSITORY_INTERFACE_POST_PROCESSOR = "org.springframework.data.repository.core.support.RepositoryInterfaceAwareBeanPostProcessor";

/*
* (non-Javadoc)
*
* @see
* org.springframework.beans.factory.xml.BeanDefinitionParser#parse(org.
* w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext)
*/
* (non-Javadoc)
* @see org.springframework.beans.factory.xml.BeanDefinitionParser#parse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext)
*/
public BeanDefinition parse(Element element, ParserContext parser) {

try {
Expand Down Expand Up @@ -181,10 +176,6 @@ private void registerGenericRepositoryFactoryBean(ParserContext parser, T contex
builder.addPropertyValue("namedQueries",
new NamedQueriesBeanDefinitionParser(context.getNamedQueriesLocation()).parse(context.getSource(), parser));

String transactionManagerRef = StringUtils.hasText(context.getTransactionManagerRef()) ? context
.getTransactionManagerRef() : DEFAULT_TRANSACTION_MANAGER_BEAN_NAME;
builder.addPropertyValue("transactionManager", transactionManagerRef);

String customImplementationBeanName = registerCustomImplementation(context, parser, beanSource);

if (customImplementationBeanName != null) {
Expand Down

0 comments on commit 6258d05

Please sign in to comment.