aspose file tools*
The moose likes Object Relational Mapping and the fly likes EntityManager managed by application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "EntityManager managed by application" Watch "EntityManager managed by application" New topic
Author

EntityManager managed by application

Adolfo Eloy
Ranch Hand

Joined: Mar 21, 2009
Posts: 146

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.



Adolfo Eloy
Software Developer
OCPJP 6
 
wood burning stoves
 
subject: EntityManager managed by application