我正在尝试访问camelcontext.xml中的两个数据库。我有两个来自不同数据库的同名两个不同表。当我尝试访问DB1的单位表时,它的访问DB2的单位表。 我已经提到了persistence.xml和相应的orm xml。但是它访问了错误的数据库。
<persistence-unit name="com.org.client" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>META-INF/client.orm.xml</mapping-file>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServer2008Dialect"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.use_sql_comments" value="true"/>
</properties>
</persistence-unit>
<persistence-unit name="com.org.ecustomer" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>META-INF/ecustomer.orm.xml</mapping-file>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.use_sql_comments" value="true" />
</properties>
</persistence-unit>