Search in sources :

Example 1 with LoggingDelegateTransactionManager

use of de.invesdwin.context.persistence.jpa.scanning.transaction.LoggingDelegateTransactionManager in project invesdwin-context-persistence by subes.

the class PersistenceUnitContext method createTransactionManager.

private PlatformTransactionManager createTransactionManager() {
    final JpaTransactionManager jpaTransactionManager = new JpaTransactionManager();
    jpaTransactionManager.setEntityManagerFactory(getEntityManagerFactory());
    final JpaDialect jpaDialect = getJpaDialect();
    if (jpaDialect != null) {
        jpaTransactionManager.setJpaDialect(jpaDialect);
    }
    final LoggingDelegateTransactionManager loggingDelegateTransactionManager = new LoggingDelegateTransactionManager(this, jpaTransactionManager);
    final String transactionManagerBeanName = getPersistenceUnitName() + PersistenceProperties.TRANSACTION_MANAGER_NAME_SUFFIX;
    MergedContext.getInstance().registerBean(transactionManagerBeanName, loggingDelegateTransactionManager);
    Assertions.assertThat(MergedContext.getInstance().getBean(transactionManagerBeanName)).isNotNull();
    return loggingDelegateTransactionManager;
}
Also used : JpaDialect(org.springframework.orm.jpa.JpaDialect) JpaTransactionManager(org.springframework.orm.jpa.JpaTransactionManager) LoggingDelegateTransactionManager(de.invesdwin.context.persistence.jpa.scanning.transaction.LoggingDelegateTransactionManager)

Aggregations

LoggingDelegateTransactionManager (de.invesdwin.context.persistence.jpa.scanning.transaction.LoggingDelegateTransactionManager)1 JpaDialect (org.springframework.orm.jpa.JpaDialect)1 JpaTransactionManager (org.springframework.orm.jpa.JpaTransactionManager)1