Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] multiple EntityManagers in one process

Using 1.0.2. There's a certain amount of work I have to do to get some of my native queries working in 1.1 (return values for getSingleResult(), for instance, changed).

Is pretty much everybody using 1.1 now? 


On May 25, 2009, at 2:57 PM, Gordon Yorke wrote:

What version of EclipseLink are you using?  This session-name property usage is only available post EclipseLink 1.1
--Gordon


David Parker wrote:
If you need two ServerSessions to co-exist, try using "eclipselink.session-name" property:
Map prop1 = new HashMap();
// populate prop1
prop1.put("eclipselink.session-name", "session1");
EntityManagerFactory factory1 = persistence.createEntityManagerFactory("MyPU", prop1);
Map prop2 = new HashMap();
// populate prop2
prop2.put("eclipselink.session-name", "session2");
EntityManagerFactory factory2 = persistence.createEntityManagerFactory("MyPU", prop2);
 
I believe that should work but couldn't find a test and haven't tried it myself.


Thanks for your reply. I tried putting this property in the map, but the resulting factory has a ServerSession with the first ServerSession's name. I.e., my first factory was created with eclipselink.session-name = "default", and the second with eclipselink.session-name = "newdb",but the second factory still has a ServerSession with the name "default".

Is there perhaps some other config that needs to be done? This got my hopes up!

Thanks again.

- DAP

=============================================
David Parker





_______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

=============================================
David Parker





Back to the top