hi,
i'm trying to get the EntityManager em from a Schedulable like this :
EntityManagerFactory emf=Persistence.createEntityManagerFactory("em");
emi=emf.getEntityManager();
but i don't know where to put the persistence.xml to register em; i have another persisntence.xml witch is in the persistence.par file in my application ,but now for scheduling i user -service.xml and hibernate.properties outside the application.
please help,
Viorel
hi,
i found out how to resolve this problem :
you have to write:
EntityManagerFactory emf=Persistence.createEntityManagerFactory("em");
emi=emf.getEntityManager();
BUT NOT IN THE CONSTRUCTOR OF THE SCHEDULABLE
thanks,
Viorel