use of org.springframework.orm.jpa.JpaTransactionManager 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;
}
use of org.springframework.orm.jpa.JpaTransactionManager in project herd by FINRAOS.
the class DaoSpringModuleConfig method herdTransactionManager.
/**
* Our Spring JPA transaction manager that will manage the JPA transactions.
*
* @return the JPA transaction manager.
*/
@Bean
public JpaTransactionManager herdTransactionManager() {
JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setDataSource(getHerdDataSource());
transactionManager.setEntityManagerFactory(entityManagerFactory().getObject());
return transactionManager;
}
use of org.springframework.orm.jpa.JpaTransactionManager in project tutorials by eugenp.
the class HibernateSearchConfig method transactionManager.
@Bean
public PlatformTransactionManager transactionManager(EntityManagerFactory emf) {
JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setEntityManagerFactory(emf);
return transactionManager;
}
use of org.springframework.orm.jpa.JpaTransactionManager in project tutorials by eugenp.
the class PersistenceDerbyJPAConfig method transactionManager.
@Bean
public PlatformTransactionManager transactionManager(final EntityManagerFactory emf) {
final JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setEntityManagerFactory(emf);
return transactionManager;
}
use of org.springframework.orm.jpa.JpaTransactionManager in project tutorials by eugenp.
the class PersistenceJNDIConfig method transactionManager.
@Bean
public PlatformTransactionManager transactionManager(final EntityManagerFactory emf) {
final JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setEntityManagerFactory(emf);
return transactionManager;
}
Aggregations