Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

SessionFactory bean has another name as expected #973

@vdusa

Description

@vdusa

When multiple data sources are used, then dbm-gorm-diff, dbm-generate-changelog, etc. fail for the non default data sources:

For example:
We have default data source and 'another' data source in our application.yml

Running:
dbm-gorm-diff --dataSource=another
Fails with:
No bean named 'sessionFactory_dataSource_another' available

Cause:
No bean named sessionFactory_dataSource_another is registered. But list of registered beans contains sessionFactory_another.

Workaround:
We added

beans = {
	springConfig.addAlias('sessionFactory_dataSource_another', 'sessionFactory_another')
}

into grails-app/conf/spring/resources.groovy

  • Operating System: Windows 10
  • Grails Version: 3.3.9
  • Plugin Version: org.grails.plugins:database-migration:3.0.4, org.liquibase:liquibase-core:3.5.5
  • Database: MySQL
  • JDK Version: AdoptOpenJDK jdk8u202-b08

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions