Hi Mitesh,
I'm running a class, which is used for DB connections, let's call it MyEntityManager:
public class MyEntityManager {
@PersistenceUnit(unitName="myApplicationPersistenceUnit")
private EntityManagerFactory emfTmp;
private EntityManager em;
private EntityManager em2;
@PersistenceContext(unitName="myApplicationPersistenceUnit")
private EntityManager emTmp;
public MyEntityManager(){
em = emfTmp.createEntityManager();
}
public void someMethod(){
em.createQuery(....);
}
}
I also tried the @PersistenceContext EntityManager dependency injection, but both ways failed i.e. the variables stayed null.
Looking up the EntityManagerFactory using a Context.lookup method works, but then the Enhancer is not running.
Thanks again.
kniffte
[Message sent by forum member 'kniffte']
http://forums.java.net/jive/thread.jspa?messageID=478097