I am having issues with creating atomic operations in my Service classes. In my case I have a service that interacts with 2 repositories (both in the same tenant package) that I would like to wrap in a single transaction. If I add @Transactional to any of my methods there, Spring throws the following error:
org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'org.springframework.transaction.PlatformTransactionManager' available: expected single matching bean but found 2: applicationTransactionManager,tenantTransactionManager
All my individual calls on the Repositories work fine, because they are bound to the correct Hibernate configuration:
It looks like Spring does not know which Transaction Manager to select in my Service classes, even though they are logically bound to either the tenant packages or application packages (you call them 'master').
How can I solve this? Preferably in a way where I don't have to explicitly mention the Transaction Manager on every single @Transactional annotation.
I am having issues with creating atomic operations in my Service classes. In my case I have a service that interacts with 2 repositories (both in the same tenant package) that I would like to wrap in a single transaction. If I add
@Transactional
to any of my methods there, Spring throws the following error:All my individual calls on the Repositories work fine, because they are bound to the correct Hibernate configuration:
It looks like Spring does not know which Transaction Manager to select in my Service classes, even though they are logically bound to either the tenant packages or application packages (you call them 'master').
How can I solve this? Preferably in a way where I don't have to explicitly mention the Transaction Manager on every single
@Transactional
annotation.