I am implementing a Vaadin web application that connects with a database (using jpa hibernate). The aplication looks like a java-swing, but in the web.
I would like to know the best practices on how to handle the JPA Entity Manager lifecycle.
The book of vaadin explicit tells you to use EntityManager-per-Request.
However, I have seen others advocating the use of Entity-per-session, and so on.
My question is: what is the best practice and what would be the benefits and drawbacks of each choice?