title: Best practice to get EntityManagerFactory
body: <p>What is the best approach to get EntityManagerFactory in web app(jsp/servlets)?
  Is this a good way <a href="https://stackoverflow.com/questions/4543947/when-should-entitymanagerfactory-instance-be-created-opened">When should EntityManagerFactory instance be created/opened?</a>,
  or is it better to get it from JNDI, or something else?</p>