5.1. Entity manager and transaction scopes:
An EntityManager is an inexpensive, non-threadsafe object that should be used once, for a
single business process, a single unit of work, and then discarded.
This answers perfectly your question. Don't share EMs over threads. Use one EM for several transactions as long as those transactions are part of a unit of work.
Furthermore you can't use an EntityManger after you've closed it:
After the close method has been invoked, all methods on the EntityManager instance and any Query, TypedQuery, and StoredProcedureQuery objects obtained from it will throw the IllegalStateException.
Consider something like this:
public class Controller {
private EntityManagerFactory emf;
public void doSomeUnitOfWork(int id) {
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
CrudDao dao = new CrudDao(em);
Entity entity = dao.get(id);
entity.setName("James");
dao.save(entity);
em.getTransaction.commit();
em.close();
}
}