title: Hibernate - EntityManager management
body: <p>I am moving a JPA-Hibernate application from a Java EE 6 environment to a Tomcat 7 one.</p>
  
  <p>The application has several DAO classes making queries on the <code>EntityManager</code>. In the Java EE environment I could just inject it using the <code>@PersistenceContext</code> annotation, and let the container manage the <code>EntityManager</code>. Now that I have to do it manually, I was wondering what is the way to go.</p>
  
  <p>Should the entity manager be unique? If so can it be a <code>static final</code> field, created on startup and that every DAO class uses? Does it have a lifecycle that involves closing it and then re-opening it?</p>