users@glassfish.java.net

Re: Surprising JPA (Toplink) Behaviour (glassfish v1 UR1)

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Fri, 16 Mar 2007 12:05:44 -0700

Before you make a change, can you please file a bug with your existing code that
reproduces the exception?

thanks,
-marina

glassfish_at_javadesktop.org wrote:
> It keeps getting more interesting. I tried our code on v2b39 to see if it behaved differently, and discovered that createEntityManagerFactory() throws a hissy fit if it's called multiple times witih the same PU name. Or, at least, that's what I'm guessing this exception means...
>
> Exception [TOPLINK-28009] (Oracle TopLink Essentials - 2.0 (Build b39-rc (03/13/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
> Exception Description: Attempted to redeploy a session named file:/Users/pohl/RCCL/build/web/WEB-INF/classes/-RCCLPU without closing it.
> at oracle.toplink.essentials.exceptions.EntityManagerSetupException.attemptedRedeployWithoutClose(EntityManagerSetupException.java:76)
> at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.addSessionToGlobalSessionManager(EntityManagerSetupImpl.java:262)
> at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.initServerSession(EntityManagerSetupImpl.java:879)
> at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:188)
> at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:78)
> at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:111)
> at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:105)
> at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:76)
> at com.sun.enterprise.util.EntityManagerFactoryWrapper.createEntityManager(EntityManagerFactoryWrapper.java:91)
> at net.nanonation.rccl.beans.RestaurantsController.getEntityManager(RestaurantsController.java:52)
>
>
> ...so it looks like I need a process-wide singleton of the emf, which should be easy to accomplish. That will be my next experiment.
> [Message sent by forum member 'pohl' (pohl)]
>
> http://forums.java.net/jive/thread.jspa?messageID=208484
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>