-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue when using @Transactional #16
Comments
Hi fabien, This happens because we register an internal transaction manager for the secondary data source. @Transactional("transactionManager") // This is the "default" one, registered by your application I'd ask you to try this and see if it goes away. I'm not sure how to apply this setting globally/by default in order not to have to change all EDIT: Another solution could be to use the |
Hello, indeed it works like this, but I would be nice that integrating dbadmin would not require any modification in existing bean configuration. (I have a lot of existing @transactional, I won't modify all of them)
|
Yes, indeed it's ideal to not require any modification. But I think at least adding |
I've read a little bit more about this. Ideally I would need something like a From my limited knowledge such an annotation doesn't exist. These issues might be related so I'm saving them for future reference: |
There are way to instantiate the JPARepository programmatically without the needs of beans. Be doing there will be no conflicts with the main application beans. |
The previous version was using There might be a way to get the correct names by querying some Spring class, but I then decided to rewrite using JPA and solve all of this at once. I will look into instantiating them without making them beans. |
This should be fixed with this latest commit on the |
Describe the bug
When we use the @transactional annotation, it fails at runtime saying there are two TransactionManager available (NoUniqueBeanDefinitionException)
Is the bug at startup before you perform any action?
No, it's at runtime when going to a @transactional annotated method
Stacktrace
No qualifying bean of type 'org.springframework.transaction.TransactionManager' available: expected single matching bean but found 2: transactionManager,internalTransactionManager
The text was updated successfully, but these errors were encountered: