diff --git a/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java b/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java index 53d5ce5fc779673caa12c4a2966f8aff6abac811..09293cc426dc55c3afe403ed3a3f66b29c590207 100644 --- a/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java +++ b/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java @@ -27,8 +27,8 @@ import javax.sql.DataSource; @EntityScan(basePackages = "eu.hbp.mip.model") public class PersistenceConfiguration { - @Bean(name = "datasource") @Primary + @Bean(name = "datasource") @ConfigurationProperties(prefix="spring.datasource") public DataSource dataSource() { return DataSourceBuilder.create().build(); @@ -51,7 +51,7 @@ public class PersistenceConfiguration { @DependsOn("flyway") public LocalContainerEntityManagerFactoryBean metaEntityManagerFactory() { LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); - em.setDataSource(dataSource()); + em.setDataSource(metaDataSource()); JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); em.setJpaVendorAdapter(vendorAdapter); return em;