fixed broken persistence settings

This commit is contained in:
2019-01-18 16:47:32 +01:00
parent 37290a2ed7
commit 48a6ca9231
3 changed files with 18 additions and 8 deletions

View File

@ -26,10 +26,8 @@ public class PersistenceContextFactory {
// account UI is the only application where application and account is the same database
// account UI does not call this as it references all database access via accountPu
@PersistenceUnit (unitName = "accountPu")
EntityManagerFactory applicationEntityManagerFactory;
EntityManagerFactory entityManagerFactory;
@PersistenceUnit (unitName = "accountPu")
EntityManagerFactory accountEntityManagerFactory;
@Produces
@RequestScoped
@ -38,7 +36,7 @@ public class PersistenceContextFactory {
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("getting entityManager for application");
}
EntityManager em = applicationEntityManagerFactory.createEntityManager(SynchronizationType.UNSYNCHRONIZED);
EntityManager em = entityManagerFactory.createEntityManager(SynchronizationType.UNSYNCHRONIZED);
return em;
}
@ -57,7 +55,7 @@ public class PersistenceContextFactory {
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("getting entityManager for account database");
}
EntityManager em = accountEntityManagerFactory.createEntityManager(SynchronizationType.UNSYNCHRONIZED);
EntityManager em = entityManagerFactory.createEntityManager(SynchronizationType.UNSYNCHRONIZED);
return em;
}

View File

@ -1,7 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="accountPu" transaction-type="RESOURCE_LOCAL">
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<persistence-unit name="accountPu" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/jboss/accountDs</jta-data-source>
<class>de.muehlencord.shared.account.business.account.entity.AccountEntity</class>
<class>de.muehlencord.shared.account.business.account.entity.AccountHistoryEntity</class>
<class>de.muehlencord.shared.account.business.account.entity.AccountLoginEntity</class>
<class>de.muehlencord.shared.account.business.account.entity.ApiKeyEntity</class>
<class>de.muehlencord.shared.account.business.application.entity.ApplicationEntity</class>
<class>de.muehlencord.shared.account.business.application.entity.ApplicationPermissionEntity</class>
<class>de.muehlencord.shared.account.business.application.entity.ApplicationRoleEntity</class>
<class>de.muehlencord.shared.account.business.config.entity.ConfigEntity</class>
<class>de.muehlencord.shared.account.business.mail.entity.MailTemplateEntity</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
<validation-mode>NONE</validation-mode>
<properties>