As Vaadin 7 removed the HttpServletRequestListener, you must now use servlet filters for this. The documentation has still to be updated before final release, but an example can be found in
the LazyHibernate integration test .
The example linked above basically creates a servlet filter that creates a new entity manager for each request and stores it in a ThreadLocal in the LazyHibernateEntityManagerProvider (also in the example). After this, each JPAContainer that is created should use the LazyHibernateEntityManagerProvider by calling
LazyHibernateEntityManagerProvider entityManagerProvider = new LazyHibernateEntityManagerProvider();
myContainer.getEntityProvider().setEntityManagerProvider(entityManagerProvider);
or alternatively setting it up when creating the EntityProvider.
In a real-world application, you might want to check what the URI is before creating entity managers, so that they are not unnecessarily created, even though this is a light operation.