Skip to content
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

7.1.0 Cannot mark non-abstract methods as @Transactional #1375

Closed
4 tasks done
jjelliott opened this issue Sep 11, 2020 · 1 comment
Closed
4 tasks done

7.1.0 Cannot mark non-abstract methods as @Transactional #1375

jjelliott opened this issue Sep 11, 2020 · 1 comment

Comments

@jjelliott
Copy link

A dev is unable to mark non-abstract methods as @Transactional or @ReadOnly in applications with multiple datasources. If they do, they will get a NoUniqueBeanDefinitionException and the application will not boot.

This appears to be related to this change: 871d062

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Create app with two or more dataSources
  2. Create abstract Data Services
  3. Attempt to mark them as transactional

Expected Behaviour

App should boot correctly

Actual Behaviour

Application will fail to start.

When inspecting debug logs, a message similar to this can be seen:

DEBUG o.s.b.f.s.DefaultListableBeanFactory     : Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'someDataService': Invocation of init method failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.example.$SomeDataServiceImplementation': Unsatisfied dependency expressed through bean property 'transactionManager'; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'org.springframework.transaction.PlatformTransactionManager' available: expected single matching bean but found 3: transactionManager_secondary,$primaryTransactionManager,transactionManager

Environment Information

  • Operating System: Ubuntu 20.04
  • GORM Version: 7.1.0.M3
  • Grails Version (if using Grails): 4.1.0.BUILD-SNAPSHOT
  • JDK Version: 1.8 and 11

Example Application

https://github.com/jjelliott/grails-410-multiple-ds-service-error

@jjelliott
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant