use of org.springframework.orm.jpa.JpaTransactionManager in project Logos_Materials_October_2017 by VolodymyrZavada.
the class DatabaseConfig method getTransactionManager.
@Bean(name = "transactionManager")
@Autowired
public PlatformTransactionManager getTransactionManager(EntityManagerFactory emf) throws NamingException {
JpaTransactionManager jpaTransaction = new JpaTransactionManager();
jpaTransaction.setEntityManagerFactory(emf);
return jpaTransaction;
}
use of org.springframework.orm.jpa.JpaTransactionManager in project Logos_Materials_October_2017 by VolodymyrZavada.
the class DatabaseConfig method getTransactionManager.
@Bean(name = "transactionManager")
@Autowired
public PlatformTransactionManager getTransactionManager(EntityManagerFactory emf) throws NamingException {
JpaTransactionManager jpaTransaction = new JpaTransactionManager();
jpaTransaction.setEntityManagerFactory(emf);
return jpaTransaction;
}
use of org.springframework.orm.jpa.JpaTransactionManager in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850PersistenceConfig method transactionManager.
/**
* Method for creating the Transaction Manager.
*
* @return JpaTransactionManager
* @throws ClassNotFoundException
* when class not found
*/
@Bean
public JpaTransactionManager transactionManager() throws ProtocolAdapterException {
final JpaTransactionManager transactionManager = new JpaTransactionManager();
try {
transactionManager.setEntityManagerFactory(this.iec61850EntityManagerFactory().getObject());
transactionManager.setTransactionSynchronization(JpaTransactionManager.SYNCHRONIZATION_ALWAYS);
} catch (final ClassNotFoundException e) {
final String msg = "Error in creating transaction manager bean";
LOGGER.error(msg, e);
throw new ProtocolAdapterException(msg, e);
}
return transactionManager;
}
use of org.springframework.orm.jpa.JpaTransactionManager in project crnk-framework by crnk-project.
the class JpaTestConfig method transactionManager.
@Bean
public PlatformTransactionManager transactionManager(final EntityManagerFactory emf) {
final JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setEntityManagerFactory(emf);
transactionManager.setDataSource(testDataSource());
return transactionManager;
}
use of org.springframework.orm.jpa.JpaTransactionManager in project crnk-framework by crnk-project.
the class OperationsTestConfig method transactionManager.
@Bean
public PlatformTransactionManager transactionManager(final EntityManagerFactory emf) {
final JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setEntityManagerFactory(emf);
transactionManager.setDataSource(testDataSource());
return transactionManager;
}
Aggregations