title: When to create a new EntityManager
body: <p>I'm working with JPA (Eclipselink) in an unmanaged (no EJBs) context. </p>
  
  <p>My question is: How long should I keep a Entity Manager open?</p>
  
  <p>Swing Application:
  - One open Entity Manager as long as the application is running
  - Each single action a new Entity Manager</p>
  
  <p>Web Application:
  - One Entity Manager per (distinct) action
  - One per request
  - One per session
  - One per application(-scope), asuming the application is thread safe</p>
  
  <p>Best Regards</p>