Skip to content
Snippets Groups Projects
Commit c2cce3f6 authored by Ludovic Claude's avatar Ludovic Claude
Browse files

Rollback explicit transaction management

parent ce192eb3
No related branches found
No related tags found
1 merge request!3[pull] master from LREN-CHUV:master
......@@ -11,12 +11,9 @@ import org.springframework.boot.orm.jpa.EntityScan;
import org.springframework.context.annotation.*;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.sql.DataSource;
......@@ -26,7 +23,6 @@ import javax.sql.DataSource;
@Configuration
@EnableJpaRepositories("eu.hbp.mip.repositories")
@EnableTransactionManagement
@EntityScan(basePackages = "eu.hbp.mip.model")
public class PersistenceConfiguration {
......@@ -71,20 +67,11 @@ public class PersistenceConfiguration {
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(portalDataSource());
//em.setPackagesToScan("eu.hbp.mip.model");
em.setPersistenceUnitName("portal");
JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
return em;
}
@Bean
public PlatformTransactionManager transactionManager() {
JpaTransactionManager txManager = new JpaTransactionManager();
txManager.setEntityManagerFactory(entityManagerFactory().getNativeEntityManagerFactory());
return txManager;
}
@Bean(name = "flyway", initMethod = "migrate")
public Flyway migrations() {
Flyway flyway = new Flyway();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment