package no.valg.valgnatt.database;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.Profile;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.jta.JtaTransactionManager;

@Profile("!test")
@Configuration
@EnableTransactionManagement
public class DatabaseProdTransactionSpringConfiguration {

    @Bean
    @DependsOn("flywayLoader")
    public PlatformTransactionManager transactionManager() {
        return new JtaTransactionManager();
    }

}
