users@glassfish.java.net

Re: JEE 6 / Glassfish v3 / Eclipse - JPA Entity Manager Issues

From: <glassfish_at_javadesktop.org>
Date: Thu, 08 Apr 2010 07:45:34 PDT

What I use in my war project and in my managed bean is something like this :

[i]@ManagedBean(name = "someBeanUtil")
@SessionScoped
public class SomeManagedBean {

@PersistenceUnit
EntityManagerFactory emf;

public void someFunction() {
  EntityManager em = emf.createEntityManager();
  ....
  em.close();
}
}[/i]
[Message sent by forum member 'rjuncu']

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