users@glassfish.java.net

Re: JPA toplink: Impossible to override User/Pass in new EntityManager

From: <glassfish_at_javadesktop.org>
Date: Wed, 02 Apr 2008 04:41:48 PST

I have just read:

You may specify any TopLink JPA extension in a persistence.xml file and you may pass any TopLink JPA extension into Persistence method createEntityManagerFactory.

Currently, no TopLink JPA extensions are applicable to EntityManagerFactory method createEntityManager.

at http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/toplink-jpa-extensions.html#TopLinkJDBC

Could be this the explanation?
If so.... Why the hell the api includes the signature createEntityManager(Map map), and the api java doc says:

 EntityManager createEntityManager(java.util.Map map)
          Create a new EntityManager with the specified Map of properties.

if IT IS NOT IMPLEMENTED?


Another try I made was to delete user/pass properties from persistence.xml, and
add them on runtime, but it obviously doesn't work for the same reason. It seems... it is nothing implemented to do it. I had seen an example of OpenJPA doint exactly that, and it works, but... not in my case, becacuse:

manager = emf.createEntityManager(jpaMap);

Is only smoke.
[Message sent by forum member 'fonsito' (fonsito)]

http://forums.java.net/jive/thread.jspa?messageID=267283