Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Appropiate place for creating and closing EntityManagerFactory in Application Managed EntityManager  RSS feed

Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!