This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I'd like to build a simple solution with JSF and JPA (Hibernate impl). As I'm using tomcat, I think I need to use an entity manager managed by application instead of managed by container.
So I've created an util class that gives EntityManager instances for me as follows in the code below.
I'd like to know if this practice can be used or may cause problems in future because I don't have a way to close my EntityManagerFactory.