users@glassfish.java.net

Putting EntityManagerFactory into JNDI

From: <glassfish_at_javadesktop.org>
Date: Wed, 23 Jan 2008 05:16:19 PST

Hi,

I'm trying to make Seam work in Glassfish in an EAR-packaged app using Seam-managed persistence context. The roadblock that I'm facing right now is that Seam wants to look up the EntityManagerFactory through JNDI, but Glassfish doesn't put it there. Now, I don't want to put @PersistenceUnit annotations on every single one of my EJBs to make Glassfish put the EMF into its environment. Instead, I'd like to invoke some piece of code (a stateless session bean?) that would get the EMF through injection and would then publish it under some global JNDI name.

My questions are, is this going to work and what potential pitfalls to this approach can you see?

Thanks.
[Message sent by forum member 'koser' (koser)]

http://forums.java.net/jive/thread.jspa?messageID=255330