I'm using JPA with Wildfly and I am connecting to multiple databases. Below is the persistence.xml -
<persistence-unit name="ContiegoDS" transaction-type="JTA">
<jta-data-source>java:jboss/datasources/ContiegoDS</jta-data-source>
<mapping-file>META-INF/orm.xml</mapping-file>
<mapping-file>META-INF/orm-legacy.xml</mapping-file>
<mapping-file>META-INF/queries/native.xml</mapping-file>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.spatial.dialect.mysql.MySQLSpatial56Dialect" />
<property name="hibernate.globally_quoted_identifiers" value="true"/>
<property name="hibernate.hbm2ddl.import_files_sql_extractor" value="org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor" />
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
<persistence-unit name="ContiegoWebsiteDS" transaction-type="JTA">
<jta-data-source>java:jboss/datasources/ContiegoWebsiteDS</jta-data-source>
<mapping-file>META-INF/orm-website.xml</mapping-file>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.spatial.dialect.mysql.MySQLSpatial56Dialect" />
<property name="hibernate.globally_quoted_identifiers" value="true"/>
<property name="hibernate.hbm2ddl.import_files_sql_extractor" value="org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor" />
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
I'm calling it this way
public class ContiegoEJB {
@PersistenceContext(unitName="ContiegoDS")
protected EntityManager contiegoEntityManager;
@PersistenceContext(unitName="ContiegoWebsiteDS")
protected EntityManager contiegoWebsiteEntityManager;
public ContiegoEJB() {
}
}
But I'm getting this error
Comparisson between orm and orm-website.xml files
AdminUser and AdminUserPasswordRecovery entities...
Relation many to one from AdminUserPasswordRecoveryRequest to AdminUser
What can I possible doing wrong?