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