Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EntityManager managed by application

 
Adolfo Eloy
Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody.

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.

Thanks in advance.


 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic