Hi, I need to lookup an entitymanager using JNDI on websphere 6.1. My persistence.xml is configured to use JPA. Although I use injection (which works) in almost all cases, I have a case where I would like the use of entitymanager in a POJO and therefore would like to get it from JNDI directly.
The case is I have a cache which should be initialized with values from the database the first time it is accessed. The cache class is a POJO class. I don't seem to find any documentation regarding this. Is this a websphere limitation ? Also, currently this class is trying to create a factory of its own within the container using Persistence.createEntityManagerFactory(unitname) but that fails as for some reason a SAX exception is thrown during parsing Persistence.xml file at the point where it tries to load the jar files containing the various entity classes. So my second question is, is there some sort of restriction on the use of Persistence.createEntityManager() inside the container? Have uploaded the class as well as the persistence.xml file. http://n2.nabble.com/file/n2121433/ParamValuesCache.java ParamValuesCache.java http://n2.nabble.com/file/n2121433/persistence.xml persistence.xml -- View this message in context: http://n2.nabble.com/Entitymanager-lookup-using-JNDI-on-webshpere-tp2121433p2121433.html Sent from the OpenJPA Users mailing list archive at Nabble.com.