----- Original Message ----- 
Sent: Monday, May 25, 2009 10:18 AM
Subject: Re: Fw: [eclipselink-users] multiple EntityManagers in one 
process
 
  
  
  Gordon,
   
  I 
  recommended this approach some time last week, but it didn't seem to 
  work.
  I 
  don't know what was the configuration (J2E or JSE).
   
  Thanks,
   
  Andrei
  ----- 
  Original Message ----- 
  
  
  Sent: Thursday, May 21, 2009 12:35 PM
  Subject: Re: [eclipselink-users] multiple EntityManagers in one 
  process
 
  
  
  
    
    
    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