0

I was struck , please help on this. My life is happy(Everything is working) when I was using 6 and WebSphere 7.5, but now, we have to migrate to Java 7, WebSphere 8.5.5.12. My requirement is like, same DB for 3 countries with different schema, all beans are same for 3 countries, but when I am trying to get persistence unit for SG, it is returning default HK one.

 <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>
4
  • Is ths MY_IN persistent unit correct ? Is it only the MY_SG that is not loaded correctly ? Mar 9, 2018 at 12:56
  • Yes My_IN is loading properly , problem with MY_SG is loading with default configuration Mar 11, 2018 at 12:30
  • tried with single persistence.xml, but still not loading other countries, for all taking default country. Mar 13, 2018 at 4:07
  • Seems to be some issue in WebSphere version, moved to the sub folder , its working as expected now. Dec 3, 2018 at 7:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.