[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] connecting with different usernames in the same process
|
Never mind. I had an EntityManagerFactory being created earlier in the
process, and wasn't passing the new properties to get entitymanager2.
Not so subtle!
/thx
On Apr 20, 2009, at 1:10 PM, David Parker wrote:
In my application I need to make connections to 2 separate database
usernames. I get the main entitymanager1,then create a second
entitymanager1 with a different username. I need to get a Connection
from the second entitymanager. I am using code like this:
private Accessor getAccessor() {
EntityManagerImpl em = (EntityManagerImpl) entityManager2;
session = em.getServerSession();
Accessor accessor =
session.getDefaultConnectionPool().acquireConnection();
accessor.incrementCallCount(session);
return accessor;
}
The Connection I'm ending up with is for the username from
entitymanager1, where I need a Connection from entitymanager2.
Is this because I am using getDefaultConnectionPool? How should I
handle different database connections in this case?
Thanks.
=============================================
David Parker
dap@xxxxxxxxxxxxxxxxxxxx
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
=============================================
David Parker
dap@xxxxxxxxxxxxxxxxxxxx