JPA : Entity Manager  As you read in the guide for
EntityManagerFactory, to control the persistence of your objects
you will require at least one EntityManagerFactory. Once you
have obtained this object you then use this to obtain an
EntityManager. An EntityManager provides access to the
operations for persistence of your objects. This short guide
will demonstrate some of the more common operations.  Important
: An EntityManagerFactory is designed to be thread-safe. An
EntityManager is not  You obtain an EntityManager from an
EntityManagerFactory as follows  EntityManager em =
emf.createEntityManager();  In the case of using container-
managed JavaEE, you would instead obtain the EntityManager by
injection  EntityManager em;  In general you will be performing
all operations on a EntityManager within a transaction, whether
your transactions are controlled by your JavaEE container, by a
framework such as Spring, or by locally defined transactions. In
the examples below we will omit the transaction demarcation fo