From fb179c4dd5c0fbdd15aabbc2a01f6d7e9e8806ba Mon Sep 17 00:00:00 2001 From: zyro Date: Thu, 31 Oct 2019 08:09:49 +0100 Subject: [PATCH] fix for grails-plugins/grails-database-migration#157 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) --- .../command/ApplicationContextDatabaseMigrationCommand.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/org/grails/plugins/databasemigration/command/ApplicationContextDatabaseMigrationCommand.groovy b/src/main/groovy/org/grails/plugins/databasemigration/command/ApplicationContextDatabaseMigrationCommand.groovy index 86a8a5a7..258b9b39 100644 --- a/src/main/groovy/org/grails/plugins/databasemigration/command/ApplicationContextDatabaseMigrationCommand.groovy +++ b/src/main/groovy/org/grails/plugins/databasemigration/command/ApplicationContextDatabaseMigrationCommand.groovy @@ -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