我很震惊,请帮忙。当我使用6和WebSphere 7.5时,我的生活很幸福(一切正常),但现在,我们必须迁移到Java 7,WebSphere 8.5.5.12。 我的要求是,对于具有不同模式的3个国家/地区的相同数据库,3个国家/地区的所有bean都相同,但是当我尝试获取SG的持久性单元时,它将返回默认HK 1。
<bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="MY_HK">
<property name="persistenceUnitName" value="MyProjHK" />
<property name="dataSource" ref="dataSource"></property>
<property name="jpaVendorAdapter" ref="openJpaVendorAdapter" />
<property name="persistenceXmlLocation" value="classpath*:META-INF/persistence.xml"></property>
</bean>
<bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="MY_IN">
<property name="persistenceUnitName" value="MyProjIN" />
<property name="dataSource" ref="dataSource"></property>
<property name="jpaVendorAdapter" ref="openJpaVendorAdapter" />
<property name="persistenceXmlLocation" value="classpath*:META-INF/persistenceIN.xml"></property>
</bean>
<bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="MY_SG">
<property name="persistenceUnitName" value="MyProjSG" />
<property name="dataSource" ref="dataSource"></property>
<property name="jpaVendorAdapter" ref="openJpaVendorAdapter" />
<property name="persistenceXmlLocation" value="classpath*:META-INF/persistenceSG.xml"></property>
</bean>