Quote: |
context class loader management on the importer and exporter Spring DM has the ability to do context class loader management on both the importer and exporter side. Normally, if Spring DM works on both sides, only one side should have this feature enabled. However, if both sides (importer and exporter) take advantage of this capability, the last entity in the call chain will win. This means that the exporter setting, if enabled, will always override the importer setting (whatever that is). |
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="plannerDataSource" /> <property name="persistenceUnitName" value="planner" /> <property name="jpaVendorAdapter" ref="jpaVendorAdapter"/> <property name="jpaProperties"> <props> <prop key="eclipselink.session.customizer">org.planner.eclipselink.transaction.session.customizer.TransactionSessionCustomizer</prop> </props> </property> </bean> <osgi:service ref = "entityManagerFactory" auto-export="all-classes" context-class-loader="service-provider" />
String serviceName = javax.persistence.EntityManagerFactory.class.getName() ; EntityManagerFactoryInfo emi = (EntityManagerFactoryInfo)appContext.getBean( "entityManagerFactory" ) ; Activator.getBundleContext().registerService( serviceName, emi.getNativeEntityManagerFactory(), null);
String serviceName = javax.persistence.EntityManagerFactory.class.getName() ;
<osgi:service ref = "entityManagerFactory" interface="javax.persistence.EntityManagerFactory" context-class-loader="service-provider" />
<osgi:service ref = "entityManagerFactory" interface="javax.persistence.EntityManagerFactory" />
<osgi:service ref = "entityManagerFactory" context-class-loader="service-provider" interface="javax.persistence.EntityManagerFactory" />