1. PersistenceManager.getEntityManagerFactory() is not thread safe. It's ok to create the EMF eagerly as usually the actual PU processing happens at the first emf.getEntityManager() request.
2. The following code will not close the EM in case of an exception: