Open nobeans opened 4 years ago
The implementation of GroovyChange seems wrong.
GORM set up beans for each dataSource as follows.
dataSource
transactionManager
liquibase
:
dataSource_liquibase
transactionManager_liquibase
The current implementation of GroovyChange
uses dataSource bean name as dataSource name. For the default dataSource, the both of them are same, dataSource
. But for the additional dataSource which dataSource name is liquibase
, the dataSource bean name become dataSource_liquibase
internally. This difference makes using wrong transactionManager bean, transactionManager_dataSource_liquibase
.
https://github.com/grails-plugins/grails-database-migration/blob/master/src/main/groovy/org/grails/plugins/databasemigration/liquibase/GroovyChange.groovy#L312 https://github.com/grails-plugins/grails-database-migration/blob/master/src/main/groovy/org/grails/plugins/databasemigration/DatabaseMigrationTransactionManager.groovy#L28-L32
To fix it, you get rid of the prefix of dataSource_
of the bean name if its exists.
A workaround is to alias the incorrect names to the correct names in spring/resources.groovy.
Task List
Steps to Reproduce
Define an additional
dataSources
in application.yml as follows:Use the dataSource for
grails.plugin.databasemigration
.Run grails application.
Expected Behaviour
The application run up normally.
Actual Behaviour
The error occurs:
Environment Information
Example Application