users@glassfish.java.net

Re: bizarre casting problem

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Thu, 03 Jan 2008 14:09:08 -0800

The app server creates EMFs and closes them on redeploy if you inject or look it
up, not when you use Persistence.createEMF() call. Same holds true for the EMs
(i.e. injection/lookup will be handled by the container, emf.createEM() makes
the caller responsible for the cleanup).

Regards,
-marina

Glenn Holmer wrote:
> Jamey Wood wrote:
>
>>I've seen this behavior when a web application isn't careful to close
>>all EntityManagerFactory and EntityManager instances it creates.
>
>
> I found one EntityManager that wasn't getting closed, and will take the
> article's advice about creating the EntityManagerFactory in a servlet
> context listener... or is it done differently when using GlassFish since
> it's a true app server (I'm a Tomcat refugee)?
>