Okey...
I want Glassfish to manage stuff, but NOT my persistence unit stuff, which I want to do Spring way. Now I have my class annotated...
@PersistenceContext
public void setEntityManager(EntityManager entityManager) {
this.entityManager = entityManager;
}
PU is
<persistence-unit name="WebStorePU">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
...
Sprig ApplicationContxt
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="webStoreDataSource"/>
<property name="loadTimeWeaver">
<bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
</property>
</bean>
<bean id="webStoreDao" class="org.objectmaster.webstore.dao.WebStoreDao"/>
GlassFish is too smart and finds persistence unit and registers it to itself?
WHERE? It does not appear under JNDI tree, so I can't access it in spring through JNDI
Better choice would be for me to have this PU file named somehow different so GlassFish does not tries to be too smart, but it IS too smart, as it notcies that my classes are annotated with PersistenceContext and tries to find PU and fails... How to disable this stuff, how to make GlassFish not to do what I don't want to do... or if it does, then how to make it do as normal ppl do...
[Message sent by forum member 'janis_olekss' (janis_olekss)]
http://forums.java.net/jive/thread.jspa?messageID=328061