use of com.alliander.osgp.core.db.api.iec61850.exceptions.Iec61850CoreDbApiException in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850OsgpCoreDbApiPersistenceConfig method iec61850OsgpCoreDbApiTransactionManager.
/**
* Method for creating the Transaction Manager.
*
* @return JpaTransactionManager
* @throws ClassNotFoundException
* when class not found
*/
@Bean
public JpaTransactionManager iec61850OsgpCoreDbApiTransactionManager() throws Iec61850CoreDbApiException {
final JpaTransactionManager transactionManager = new JpaTransactionManager();
try {
transactionManager.setEntityManagerFactory(this.iec61850OsgpCoreDbApiEntityManagerFactory().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 Iec61850CoreDbApiException(msg, e);
}
return transactionManager;
}
Aggregations