users@glassfish.java.net

Re: Sharing EntityManagerFactory between spring app and EJB3.1 a

From: <forums_at_java.net>
Date: Thu, 26 Jan 2012 12:45:08 -0600 (CST)

Hi Sahoo,

Is there a solution that only entails a configuration change in spring (Same
as described here [1], getting EMF by jndi)?  It looks simpler. Also, with
the osgi solution it requires replacing @PersistenceContext annotation with
calling emf.getEntityManager() in all the DAOs in the spring app. 

Regading hibernate, we've managed to work with hibernate probably because we
don't have "pure" osgi bundles. Our bundles contain hibernate in their
WEB-INF/lib and not consuming hibernate from hibernate osgi bundle. Do you
think I should be able to register and consume EMF in such bundles?
Anyway, what do I lose if I'm not sharing EMF (except from duplicate
configuration of provider and other props)? maybe it's not that bad to share
only DS..
Thanks!
 


[1]
http://forum.springsource.org/showthread.php?102028-Spring-JPA-Glassfish-JNDI

--
[Message sent by forum member 'Karo']
View Post: http://forums.java.net/node/882978