I noticed that the entity manager got by:
PersistenceContext(type= PersistenceContextType.TRANSACTION) private EntityManager em;