Skip to content

Is EntityManager meant to be disposable? #205

Answered by edobrb
Atlinx asked this question in Q&A
Discussion options

You must be logged in to vote

Absolutely yes, you should create a new EntityManager for each request. In some cases you may want to instantiate an EntityManager with different metadata depending on the user. Also, all the DAO inside the EntityManager are lazy instantiated so it's quite lightweight.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Atlinx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants