Entity Menager and session


I have questions about Session and EntityManager. I build method to acces database with use EntityManager in other plugin RCP, because i would like use this method in desktop project. But in the vaadin when we would like manipulation in the database I must use session.

And how i can use Session with a EntityManagerFactory ?