Skip to content

Commit

Permalink
fix for grails#157
Browse files Browse the repository at this point in the history
when constructing the sessionFactory bean name for a secondary dataSource, just append the suffix, not the complete dataSource bean name (i.e. sessionFactory_another instead of sessionFactory_dataSource_another)
  • Loading branch information
zyro23 committed Oct 31, 2019
1 parent 2e5fca6 commit fb179c4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ trait ApplicationContextDatabaseMigrationCommand implements DatabaseMigrationCom
String dataSourceName = getDataSourceName(dataSource)
String sessionFactoryName = "sessionFactory"
if (!isDefaultDataSource(dataSource)) {
sessionFactoryName = sessionFactoryName + '_' + dataSourceName
sessionFactoryName = sessionFactoryName + '_' + dataSource
}

def serviceRegistry = applicationContext.getBean(sessionFactoryName, SessionFactoryImplementor).serviceRegistry.parentServiceRegistry
Expand Down

0 comments on commit fb179c4

Please sign in to comment.