• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Appropiate place for creating and closing EntityManagerFactory in Application Managed EntityManager

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am planning to use , Application Managed EntityManager for my web based Application . I have made this class for getting access to EntityManagaerFactory .

As Creating EntityManagerFactory are expensive


Will it be a good place to write a ServletContextListener for my Web based Application to create a EntityManagerFactory inside the ContextInitilized and call the close method inside the ContextDestroyed .

Please help .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic