users@glassfish.java.net

Sharing EntityManagerFactory between spring app and EJB3.1 app deployed on

From: <forums_at_java.net>
Date: Tue, 24 Jan 2012 17:32:04 -0600 (CST)

 Hi,
I have the following requirement:
2 web apps, one is Spring, the other is EJB3.1.
Also, both are osgi bundles.
Both apps should access the same datasource.
In the spring app, I already tried to inject the datasource from jndi
(defined in GF). works fine.
The question is, can/should I also share the EntityManagerFactory? That is,
define it in the ejb bundle and use the same EMF in the spring bundle (such
that the provider, hibernate, and its properties wil be defined only once)?
does it make sense?
If so, how can I use it in the spring app?
Thanks.
 


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