@Produces
    public EntityManager getEntityManager() {
        // if (pcEm != null) {
        //     return pcEm;
        // }
        EntityManager threadLocalEm = threadLocal.get();
        if (threadLocalEm != null && threadLocalEm.isOpen()) {
            return threadLocalEm;
        } else {
            EntityManager newEm = emf.createEntityManager();
            threadLocal.set(newEm);
            return newEm;
        }
    }
@see io.apiman.manager.api.jpa.IEntityManagerFactoryAccessor#getEntityManagerFactory()
manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/EntityManagerFactoryAccessor.java