title: Design Principal for JPA EntityManger
body: <p>I am using JPA in a web application running in Tomcat 8.  I am relatively new to JPA, and am having a hard time figuring out how to properly design my web app to use EntityManager.  I have read "Java Persistence with Hibernate" and "Pro JPA 2", as well as a few posts about Entity Managers, but I am still unclear as to how to properly design my web app.</p>
  
  <p>Should I create a singleton EntityManager that is used by the web app to service all requests, such as to CRUD (create, read, update, delete) entities?</p>
  
  <p>Or should I ask the EntityManagerFactory to create a new EntityManager for each user request that comes in and close the EntityManager when I'm done processing the request?</p>
  
  <p>I'm currently doing development on my local machine, where I am the only user.<br>
  What are the pros/cons of each approach? 
  Do both scale to hundreds of users?</p>
  
  <p>I don't have the real world experience to answer these questions, so I'm looking for some answers/guidance from people who've used JPA in enterprise business apps.</p>
  
  <p>Thanks</p>