title: Should EntityManager lifetime be per Servlet Request? Or longer?
body: <p>I am currently obtaining an <code>EntityManager</code> from the <code>EntityManagerFactory</code> within the <code>doFilter</code> method of a servlet <code>Filter</code>, passing it to the Servlet, and closing it on the way out.</p>
  
  <p>Is this good practice as far as the lifetime of <code>EntityManager</code> is concerned?  Or should I have a different lifetime for <code>EntityManager</code>?</p>