No bean named 'transactionManager' is defined
Actually, there is a way to use named TransactionManager with Spring Data JPA. This works for me:
<bean id="myTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="myEntityManagerFactory" />
</bean>
<tx:annotation-driven transaction-manager="myTransactionManager"/>
<jpa:repositories base-package="com.xxx.yyy" entity-manager-factory-ref="myEntityManagerFactory" transaction-manager-ref="myTransactionManager">
</jpa:repositories>
The default value for the transaction-manager attribute is transaction-manager. In your case, you should specify which transaction manager you want to use per method or service like this:
@Service
@Transactional(value="LiveTransactionManager")
class someClass...
or
@Transactional(value="ArchiveTransactionManager")
public void someMethod
I use java configuration and specifying the transactionManagerRef was solution for me:
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(
entityManagerFactoryRef = "myCustomEntityManagerFactory",
basePackages = {"ua.demitt.other.path.to.repos"},
transactionManagerRef = "myCustomTransactionManager" )